Skip to Main Content Skip to Search
Product Documentation

Diagnostic Messages

The following table shows diagnostic messages you might encounter, probable causes for the message, and suggested solutions.

See the following table for information about some diagnostic messages.

Diagnostic Messages and Suggested Solutions

MessageProbable CauseSuggested Solution
LoadLibrary
("component_name_1_0.dll")
failed - The specified module could not be found.

You may get this error message while registering the project DLL from the DOS prompt. This usually occurs if the MATLAB product is not on the system path.

See Failure to Find a Required File.

You may get this error if you try to deploy your component without adding the path for the DLL to the system path on the target machine.

On the target machine where the COM component is to be used:

  1. Use the extractCTF.exe utility to decompress the .ctf file generated by the builder when you built the COM component.

  2. Look at the files in the CTF, and note the path for the DLL.

  3. Add this path to the system path.


See the MATLAB Compiler documentation for more information about extractctf.exe.

You may get this error if you do not have appropriate permissions to deploy a COM component on a particular system.

See Add-in and COM Component Registration.

MBUILD.BAT: Error: The chosen compiler does not support building COM objects.

The chosen compiler does not support building COM objects.

Rerun mbuild -setup and choose a supported compiler.

Error in component_name.
class_name.x: Error getting data conversion flags.

This is often caused by mwcomutil.dll not being registered.

  1. Open a DOS window.

  2. Change folders to matlabroot\runtime
    \architecture
    .

  3. Run the following command:
    mwregsvr mwcomutil.dll

(matlabroot is your root MATLAB folder.)

Error in VBAProject: ActiveX component can't create object.
  • Project DLL is not registered.

  • An incompatible MATLAB DLL exists somewhere on the system path.

If the DLL is not registered,

  1. Open a DOS window.

  2. Change folders to projectdir\distrib.

  3. Run the following command:
    mwregsvr projectdll.dll

(projectdir represents the location of your project files).

object ref not set to instance of an object

This occurs when an object that has not been instantiated is called

Instantiate the object (declare it as new). See Classes and Methodsin this User's Guide for more information.

Error in VBAProject: Automation error The specified module could not be found.

This usually occurs if MATLAB is not on the system path.

See Failure to Find a Required File.
QueryInterface for interface <COM OBJECT NAME> failed.You might be using the incorrect number and/or type of function parameters to call into your COM object. Function calls to COM objects that encapsulate MATLAB functions must have the same number and data type of arguments as the COM object. In general:
  • Use a Variant data type for the return type of the COM object.

  • Use doubles as default numeric input parameters (rather than integers).

You might also use development tools such as OLEVIEW and Object Browser, which ship with Microsoft Visual Studio and Microsoft Visual Basic, respectively, to verify the expected function signature of TypeLib for the COM object.

Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

This warning occurs when ASP.NET code tries to bring up a dialog box.

If occurs because getframe() makes the figure window visible before performing the capture and thus fails when running in IIS. msgbox() calls in MATLAB code cause the warning to appear also.

Work around this problem by doing the following:

  1. Open the Windows Control Panel.

  2. Open Services.

  3. From the list of services, select and open the IIS Admin service.

  4. In the Properties dialog, on the Log On tab, select Local System Account.

  5. Select the option Allow Service to Interact with Desktop.

Enhanced Error Diagnostics Using mstack Trace

Use this enhanced diagnostic feature to troubleshoot problems that occur specifically during MATLAB code execution.

To implement this feature, use .NET exception handling to invoke the MATLAB function inside of the .NET application, as demonstrated in this try-catch code block:

try 
{ 
Magic magic = new Magic(); 
magic.callmakeerror(); 
} 
catch(Exception ex) 
{ 
Console.WriteLine("Error: {0}", exception); 
} 

When an error occurs, the MATLAB code stack trace is printed before the Microsoft .NET application stack trace, as follows:

... MATLAB code Stack Trace ... 
    at 
file H:\compiler\g388611\cathy\MagicDemoCSharpApp\bin\Debug\
CalldmakeerrComp_mcr\compiler\g388611\ca 
thy\MagicDemoComp\dmakeerror.m,name 
dmakeerror_error2,line at 14. 
    at 
file H:\compiler\g388611\cathy\MagicDemoCSharpApp\bin\Debug\
CalldmakeerrComp_mcr\compiler\g388611\ca 
thy\MagicDemoComp\dmakeerror.m,name 
dmakeerror_error1,line at 11. 
    at 
file H:\compiler\g388611\cathy\MagicDemoCSharpApp\bin\Debug\
CalldmakeerrComp_mcr\compiler\g388611\ca 
thy\MagicDemoComp\dmakeerror.m,name dmakeerror,line at 4. 
    at 
file H:\compiler\g388611\cathy\MagicDemoCSharpApp\bin\Debug\
CalldmakeerrComp_mcr\compiler\g388611\ca 
thy\MagicDemoComp\calldmakeerror.m,name 
calldmakeerror,line at 2. 

... .Application Stack Trace ... 
   at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction
(String functionName, Int32 numArgsOut, Int 
32 numArgsIn, MWArray[] argsIn) 
   at MathWorks.MATLAB.NET.Utility.MWMCR.EvaluateFunction
(Int32 numArgsOut, String functionName, MWA 
rray[] argsIn) 
   at CalldmakeerrComp.Calldmakeerr.calldmakeerror() in 
h:\compiler\g388611\cathy\MagicDemoComp\src\ 
Calldmakeerr.cs:line 140 
   at MathWorks.Demo.MagicSquareApp.MagicDemoApp.Main(String[]
 args) in H:\compiler\g388611\cathy\Ma 
gicDemoCSharpApp\MagicDemoApp.cs:line 52 

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS