| Contents | Index |
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. | |
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:
| |
You may get this error if you do not have appropriate permissions to deploy a COM component on a particular system. | ||
| 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 folder.) |
| Error in VBAProject: ActiveX component can't create object. |
| If the DLL is not registered,
(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:
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:
|
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
![]() | Failure to Find a Required File | Reference Information | ![]() |

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 |