| MATLAB® Builder™ NE | ![]() |
The following table shows diagnostic messages you might encounter, probable causes for the message, and suggested solutions.
Note The MATLAB Builder NE product uses the MATLAB Compiler product to generate components. This means that you might see diagnostic messages from MATLAB Compiler. See Compile-Time Errors in the MATLAB Compiler documentation for more information about those messages. |
See the following table for information about some diagnostic messages.
Diagnostic Messages and Suggested Solutions
| Message | Probable Cause | Suggested 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:
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. |
(matlabroot is your root MATLAB directory.) |
| Error in VBAProject: ActiveX component can't create object. |
| If the DLL is not registered,
(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:
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. |
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
![]() | Failure to Find a Required File | Reference Information | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |