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 might also 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.
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 directories to matlabroot\bin
    \architecture
    .

  3. Run the following command:
    mwregsvr mwcomutil.dll

(matlabroot is your root MATLAB directory.)

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 directories to projectdir\distrib.

  3. Run the following command:
    mwregsvr projectdll.dll

(projectdir represents the location of your project files).

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.

Enhanced Error Diagnostics Using mstack Trace

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

To implement this feature, use .NET exception handling to invoke the M-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 M-code stack trace is printed before the Microsoft .NET application stack trace, as follows:

... Matlab M-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 

  


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