0
votes

I am trying to compile a COM object in Matlab 2011a using Matlab Builder NE. I managed to build and package it, deploy it, and even to start the COM server. I am using the following command in Matlab

c = actxserver('MyFirstComServer.Class1');

However, when I try to run any method on this handle, I get an error message like that:

c.GetNames(0,'')
??? Invoke Error, Dispatch Exception:
Source: MyFirstComServer.Class1.1_0
Description: MCR instance is not available

I have found something on the web related to it, however, it did not help me http://www.mathworks.com/support/solutions/en/data/1-2VS4TC/index.html?product=MN&solution=1-2VS4TC

Does anybody have any idea what to do?

Edit:
I've found out that the problem happens only if I call the component from Matlab.. This might have to do something with MCR confusion, the COM component uses the same MCR that Matlab uses.

1

1 Answers

0
votes

I've found out that the problem happens only if I call the component from Matlab.. This might have to do something with MCR confusion, the COM component uses the same MCR that Matlab uses.

Edit(1) From Builder NE manual.

Testing with the MCR When you test with the MCR, keep in mind that the MCR is an instance of MATLAB. Given this, it is not possible to load the MCR into MATLAB. For example, if you build a generic COM component with the Deployment Tool from MATLAB Builder NE, you generate a DLL. If you then try to test the component with an application such as actxserver, which loads its process into MATLAB, you are effectively loading the MCR into MATLAB, producing an error such as this: mwsamp.mymagic(3,[],[]) ??? Invoke Error, Dispatch Exception: Source: tmw1.Class1.1_0 Description: MCR instance is not available Therefore, understand the behaviors of third-party processes before attempting to test them with the MCR. If you are uncertain about the behavior of these processes, contact your developer or systems administrator.