f



How to access COM objects in MATLAB built with MATLAB Builder NE?

I used the MATLAB R2010b Builder NE to compile a COM-DLL (a single class with a single method) and intend to call the method from within MATLAB R2007b. I cannot distribute m-files or p-files because my code uses new object oriented features introduced in R2008a. So the idea is to install Matlab Compiler Runtime 2010b on the target machine in addition to MATLAB 2007 and access the function from a DLL.

Unfortunately, I was not able to run the method from within MATLAB and could not find any documentation on how to use MATLAB to "test" COM DLLs (or even .NET DLLs or C-DLLs) built with the MATLAB Compiler. The documentation yet is very clear on how to use external interfaces, e.g using actxserver() for COM DLLs, or NET.addAssembly() for .NET DLLs or loadlibrary() for C-DLLs.

Since I have no installation of R2007 right now I did everything in R2010 (compiling and testing). Here is what I tried for COM DLLs:
>> p = actxserver('myComponent.myClass');
>> p.myMethod(0,[],[])
??? Invoke Error, Dispatch Exception:
Source: myComponent.myClass.1_0
Description: MCR instance is not available


and for .NET DLLs:
NET.addAssembly(fullfile(cd,'myComponent.dll');
>> p = myComponent.myClass();
??? Message: The type initializer for "myComponent.myClass" threw an exception.
Source: mscorlib
HelpLink:


and for C-DLLs
>> loadlibrary('myComponent.dll','myComponent.h');
Warning: Warnings messages were produced while parsing.  Check
the functions you intend to use for correctness.  Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...) 
> In loadlibrary at 396
Warning: The data type 'FcnPtr' used by function
peaxactInitializeWithHandlers does not exist. 
> In loadlibrary at 458
Warning: The data type 'FcnPtr' used by function
peaxactInitializeWithHandlers does not exist. 
> In loadlibrary at 458
>> calllib('myComponent', 'myComponentInitialize')
ans =

     0 % --> did not initialize


I begin to wonder if it possible at all. Any help would be appriciated.
0
Dirk
10/16/2010 11:36:04 PM
comp.soft-sys.matlab 211266 articles. 22 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies
1179 Views

Similar Articles

[PageSpeed] 15

Reply:

Similar Artilces:

Matlab COM server and Matlab COM objects
Hi - I have an application that connects to the Matlab engine via COM and wants to connect to other Matlab COM objects, created with the COM tool, that are Matlab independent. I can connect to either of them sucessfully, but not to both: if I connect to the Matlab engine first, when I try to connect to a Matlab compiled COM object the CoCreate function says the object is not registered, while if I connect to the Matlab COM object first, I can do that successfully but when I try to connect to the Matlab engine, again the CoCreate function fails saying the object is not registered....

About COM objects, generated using Matlab builder, and Matlab Web server
Can someone package his GUI application into a COM object and publish it over the Web using Matlab web server? Is it possible this way that I dont have to create (for any new *.m file) a corresponding *.html or *.php file? Just re-package into a new COM object and re-publish it using matlab web server?? ...

[Q]Using Matlab COM Object(.dll) without Matlab
Is it possible using Matlab COM Object(.dll) without Matlab program? ...

MATLAB talking to MATLAB?
For my project, I need to have a client program (MATLAB executable) talking to a server program (also MATLAB executable) to query data. Is there any easy way to accomplish that? I appreciate any help that I can get on that. Thanks. Cheers, Hoi Oops, I forgot to mention. There are multiple clients querying the server, so I guess serial objects + remote serial port wouldn't work. "Hoi Wong" <wonghoi.ee@gmail.com_> wrote in message news:f3ald6$gg4$1@news.Stanford.EDU... > For my project, I need to have a client program (MATLAB executable) > talking to a ser...

Run Matlab ... from Matlab
Hello, Is there any limitation to run Matlab from Matlab, as a system command, on Linux platforms ? I tried to start Matlab, both using the ! syntax (!matlab&) or the system command (system('matlab&')), the Matlab splash screen appears, but the new Matlab session closes rapidly . When I do the same with a script of mine (system('matlab -r "myscript"&')), my script is being executed, but Matlab finally crashes . If I remove the &, it works well, but the first Matlab session is blocked till I close the second one . I run Matlab on a Linux 64bits pla...

Access from MATLAB to a non-MATLAB GUIs
Hallo everybody, In one of my MATLAB functions I invoke external EXE file (another program), which makes some calculations. At the end of the calculations a message appears if I want to quit the exernal program (with 'Yes' and 'No' buttons). I want to close this message, because it interrupts the executaion of the whole MATLAB function(a batch file). The message is generated from the exernal program, not from MATLAB, so I can't use a MATLAB handle to close it. So, does anybody knows how I can close those non-MATLAB generated message (GUI) with a command in the MATLAB...

Matlab 7: how to remove java object in Matlab?
Hi, I found that there are some GUI windows in Matlab 7 return Java objects directly instead of returnning figure handles or object handles. I want to delete them, but I tried "delete(handles.objJava)" where objJava is some Java object returned by these Matlab GUI windows..., I saved it to handles as a field... but it did not work. The error message is: ------------------------------------------ ??? Invalid handle object. Error in ==> ieMyProgram>myCallbackFcn at 162 delete(handles.objJava); ...

Spawning matlab from within matlab
Hello all, I would like to spawn multiple matlab processes from an '.m' script. Meaning, run an m-file from a 'parent' Matlab that launches, say, 8 more 'children' matlab processes. I'd like to do it in such a way that the same m-file in the 'parent' is able to close down, or kill, all the 'children' processes. Any suggestions? Joe ...

Matlab builder JA: parse java string to matlab cell
Hi all, I'm building a java swing based GUI for my Matlab application. As such, user input is available as text strings, for example "{[0; 0], [3.5 0; 0 2]}" (mean vector and covariance matrix of a 2D Gaussian). The user input will be passed to the compiled matlab method as a MWCellArray. Problem is how do a convert (parse) the above string into a MWCellArray? From its javadoc http://www.mathworks.com/access/helpdesk/help/toolbox/javabuilder/MWArrayAPI/index.html the following method is available: java.lang.String toString() Returns a string representation of this array, ...

matlab builder NE: registering COM in 64-bit machies
Hi everybody! I'm experiencing a problem when using the matlab builder NE toolbox to create a COM object. I create the dll with deploytool and it works well. The dll is registered in the system, and then I can use it from other programs (in my case Delphi 2010). I also tried to export the DLL via the MCRInstaller to other 32-bit machines and it works ok. However, if I do the same in a 64bit machines when I try to import the type library from delphi it says that the COM object is not correctly registered in the system. It is important that I'm not trying to register the 32-bits DL...

Matlab plots outside Matlab
I'm making an end-user application where I would like to use Matlab functionality both for calculation and plotting. Matlabs GUI builder guide does not satisfy my needs (no support for f.ex. internal frames and other nescessities), so I'm planning to compile my Matlab code and use other API (Java, QT or something) for GUI. My problem is then, that I loose access to the neat plotting commands availible under matlab GUI... Is there a way of integrating Matlabs plot functionality into another GUI system? - has it been done? - I appreciate any response! - P�l Berge ...

I obtained the following error when i run COM Object of Matlab Builder
Building COM object... mcc -M -silentsetup -d 'C:/MATLAB7/work/magicdemo/src' -B 'ccom:magicdemo,magicdemoclass,1.0' -g -i 'C:/MATLAB7/work/magic.m' To get started, select <a href="matlab: doc">MATLAB Help</a> or <a href="matlab: demo matlab">Demos</a> from the Help menu. The -i switch is no longer supported; the include exported interfaces behavior is applied to every compilation. Warning: (PM): Duplicate directory name: C:/MATLAB7/work. Warning: No matching builtin function available for C:/MATLAB7/toolbox/simulink/sim...

Calling Compiled MATLAB from MATLAB
Hello everyone, How do I compile MATLAB M files into a form that can then be called from within the MATLAB interpreter? A roundabout way would seem to be to (somehow) Turn the matlab code into C (I think mcc does this), then compile this C code into MEX format and call that. Is there an easier way? I have the MATLAB compiler, so I just need to know what to do with it to get this to work. Thanks in advance, Sina sina.tootoonian wrote: > > > Hello everyone, > > How do I compile MATLAB M files into a form that can then be called > from within the MATLAB interpreter? A round...

parallel matlab
Hi all, I'm going to work on a project involving a parallel version of MATLAB - I'm aware of various efforts like MATLAB-*P and so on Right now I need to read up on some material regarding MATLAB internals eg: How are the ATLAS(or is it BLAS) routines called in MATLAB? How does MATLAB's C code store information in memory, cache'ing etc? How is one to get at those? Do you know of any suitable reference(s)/resource(s)? Thank you very much, Aravind ...

matlab to matlab remote execution
Hi I have two win PCs running matlab 7. One is slow and other is a high spec fast PC. They are connected to LAN. The directory on fast PC where all matlab work takes place has been mounted as a drive on slow PC. Hence this directory on fast PC can be accessed from slow PC's matlab session. I want to let the user on slow PC run some computationally intense M scripts in his matlab session but execute them on fast PC. I tried usual unix like method. First installed telnet server on fast PC. Then used telnet client on slow PC to log on fast PC. If I attempt to start matlab in slow PC telnet ...

from Delphi to matlab and matlab to delphi
How to send vars from Delphi to Matlab ? and viceverse, from matlab to delphi ? thanks, it is dificult, and not found answers in the internet. jairo serrano wrote: > > > How to send vars from Delphi to Matlab ? and viceverse, from matlab > to delphi ? thanks, it is dificult, and not found answers in the > internet. When I want to use Matlab variables in another program, I write them to file. You can use comma separated files (csv). Try: > help csvwrite > help dlmwrite Works fine for me. Hope this helps, Niels jairo serrano wrote: > How to send vars from Delphi to...

DLL creating by Matlab for Matlab
I would like to know if it is possible to convert several M-files into one DLL with Matlab (by using mcc or mex or other functions) and use this DLL with Matlab. How can I do that? I could create DLL with mcc -l xxx.m but I can't use this DLL with Matlab (error: "??? The function, script or class xxx cannot be indexed using {} or . indexing.") I have a project on Matlab with just M-files and I want to give this project to someone who want to use it on Matlab too, but I don't want to give him the source M algorithms. Moreover, I don't want to have an executable....

matlab in JAVA or java in MATLAB?
Hi guys I am now experencing a great difficulty in the interation between java and matlab. I have an objective function written in JAVA with has method return an numerical number, i call it 'profit'. The nature of this obtive function (ObjFun.java) is that it takes an parameter input, say C, with different C value, the returned profit value is different. Eventually I want to find the optimized C value which produce the maximun profit (C will be under constrains). Initially I want to use linprog or fminsearch in matlab. So I tried the command in matlab that excutes my ObjFun.ja...

How to notify Matlab about Java object change in Matlab Java Interface?
Hello, Does anybody has any idea how to update Matlab function about Java object change ? It could be done by polling: while JavaObj.getValue()=='not done yet' pause(1); end But polling is evil. There should be more elegant way to do this job ... I've checked 'Matlab Java Interface' docs : http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f6671.html , but found nothing on the subject :( Thanks in advance for your help, Could you use javacomponent to set up the object, and set a callback to repond to the changed value? On Apr 21, 5:44=A0pm, &...

Matlab engine with matlab R2010b
Hello All, I'm working with an aplication that use the matlab engine. I made the C++ program and it is working well in my pc with matlab 2007b, but the same very basic program shows an error when I tried to compile it in a pc with matlab R2010b. The error is about the icuuc32.dll. ¿Why is asking this DLL? How can I solve this?. Thanks¡ ...

Create (Matlab) object inside C/C++ and pass it to Matlab
I'm trying to create an object inside C++ and then pass it to Matlab via en= gPutVariable. It seems I can create a struct // Create a float array mxArray *acq_data =3D mxCreateNumericMatrix(0, 0, mxSINGLE_CLASS); float *data =3D (float *)mxCalloc(M*N, sizeof(float)); mxSetData(acq_data, data); mxSetM(acq_data, M); mxSetN(acq_data, N); // Convert to struct const char *fieldname =3D "data"; mxArray *acq_struct =3D mxCreateStructMatrix(1,1,1, &fieldname); mxSetField(acq_struct,i,"data",acq_data); // Convert to class ?? Does it work? if (j=3D=3D1...

Calling Matlab in C in Matlab
Hi everybody! My problem can be described as follows. I have a tool in Matlab that requires calling an optimisation algorithm in C. This algorithm consists of several C-files, one of which contains the function to be minimised (CFUNCTION), and another is the main algorithm file (CMAIN). Now what I want to do is to call Matlab from CFUNCTION or CMAIN and specify my custom function (MFUNCTION) to be minimised. So, I'm calling Matlab from C from Matlab. I'm a newbie in C and MEX files. Should I rewrite CMAIN as a MEX file and include CFUNCTION in this and then use mxCallMATLAB? Or can...

MATLAB COM Builder
I am using COM builder with the following settings: MATLAB version 6.5 C/C++ complier .NET 2003 cl.exe After adjusting for the namespaces, I get the following error: ============================================= LINK : fatal error LNK1104: cannot open file 'msvcirt.lib' MBUILD.BAT: Error: Link of 'E:\QFS\Chk\src\Chk_1_0.dll' failed. ============================================= could someone advice me on this? thanks KV ...

Problem running Matlab-built COM Object within VS .NET
I recently upgraded to Matlab R14 and now when I build a COM object and then try to use it in my MS VS .NET application, I get the following error message when I try to run the application: "This application failed to start because the mclmcrrt70.dll was not found" The .dll exists in the MATLAB/bin/win32 directory and that directory is in my PATH variable, so I'm not sure why it can't find it. Thanks for any insights. Dean I had the same problem. The cause was that the PATH variable was faulty - it was reffering to MATLAB/bin/win32 whereas matlab is installed in MATLAB7/bi...

Web resources about - How to access COM objects in MATLAB built with MATLAB Builder NE? - comp.soft-sys.matlab

Smart Personal Objects Technology - Wikipedia, the free encyclopedia
Smart Personal Object Technology (SPOT) was developed by Microsoft to personalize household electronics and other everyday devices, through "smart" ...

Cops Object to Beyonce’s Super Bowl Performance - Al Jazeera America
Sheriffs’ petty boycott of Super Bowl performance tells us about police culture, not the singer

Chrome for Android will let you interact with nearby smart objects
... car - and not have to download an app first. Everything should be just a tap away. Explained in the most basic form, Physical Web means objects ...

"The hard, jagged object... dark blue and small enough to be held in a closed hand" fell from the sky ...
... in India: The object slammed into the ground at an engineering college over the weekend, shattering a water cooler and sending splinters ...

North Korean rocket puts object into space, angering neighbours and UN
Its neighbours and the United States denounced the launch as a missile test, conducted in defiance of UN sanctions and just weeks after a nuclear ...

India meteorite? Man killed by falling object - CNN.com
Indian scientists will examine the remains of an object that fell from the sky, causing a large explosion which killed a man, to determine if ...

Family of murdered soldier object to Apple’s fight against FBI
Many of the big tech companies may be supporting Apple’s pro-privacy stance when it comes to creating a backdoor for the iPhone, but not everyone ...

This week in the war on voting: SC officials omit voter ID info; Dems object to WV's new ID law
Welcome to our war on voting series, a joint project of Joan McCarter and Meteor Blades. It should be a source of amazement and disgust to every ...

‘Sharp Objects’ Drama Series Starring Amy Adams From Gillian Flynn, Marti Noxon & Blumhouse Shopped By ...
Entertainment One has taken out Sharp Objects , a marquee drama series package based on a book by Gone Girl author Gillian Flynn that includes ...

VR is better when virtual objects feel real
... (the illusion of flight, the exhaustion of exercise and even the emotional fatigue of trauma), it still has one major flaw: Virtual objects ...

Resources last updated: 2/25/2016 7:34:53 AM