From: Daniel on
Hello,
I want to use the COM Interface with a Delphi program but it doesn't work.
Do I need some special Toolboxes to use the interface?
The dlls mwcomutil and mwcommgr aren't in my win32 folder. Also the mwregsvr.exe isn't there.
Is it possible to invoke a COM Object without these data?
I'm using Matlab 2007b.

Thanks for any help.

Regards

Daniel
From: Ashish Uthama on
On Wed, 07 Apr 2010 10:23:07 -0300, Daniel <daniel.c.braun(a)web.de> wrote:

> Hello,
> I want to use the COM Interface with a Delphi program but it doesn't
> work.

What happens instead?

> Do I need some special Toolboxes to use the interface?
> The dlls mwcomutil and mwcommgr aren't in my win32 folder. Also the
> mwregsvr.exe isn't there.
> Is it possible to invoke a COM Object without these data?
> I'm using Matlab 2007b.
>
> Thanks for any help.
>
> Regards
>
> Daniel

The interface is part of base MATLAB, it should work out of the box.

Try this if you have Excel installed, if it works, your MATLAB side COM
interface is allright:


>> hExcel = actxserver('excel.application') %open a COM interface to Excel

hExcel =

COM.excel_application

>> hExcel.delete %close the connection
From: Daniel on
"Ashish Uthama" <first.last(a)mathworks.com> wrote in message <op.vasn3ruba5ziv5(a)uthamaa.dhcp.mathworks.com>...
> On Wed, 07 Apr 2010 10:23:07 -0300, Daniel <daniel.c.braun(a)web.de> wrote:
>
> > Hello,
> > I want to use the COM Interface with a Delphi program but it doesn't
> > work.
>
> What happens instead?
>
> > Do I need some special Toolboxes to use the interface?
> > The dlls mwcomutil and mwcommgr aren't in my win32 folder. Also the
> > mwregsvr.exe isn't there.
> > Is it possible to invoke a COM Object without these data?
> > I'm using Matlab 2007b.
> >
> > Thanks for any help.
> >
> > Regards
> >
> > Daniel
>
> The interface is part of base MATLAB, it should work out of the box.
>
> Try this if you have Excel installed, if it works, your MATLAB side COM
> interface is allright:
>
>
> >> hExcel = actxserver('excel.application') %open a COM interface to Excel
>
> hExcel =
>
> COM.excel_application
>
> >> hExcel.delete %close the connection

Thanks for the quick response,

I think I did explain the problem a little bit wrong. I don't want to start a program from matlab. I want to use the interface to start matlab in the background of my delphi program.
But I get a german error message. In Englsih it means something like:
Exception of the EOleSysError has occurred. Start of the server failed.

I try to create the Matlab Object in Delphi with the command:
MatlabObjPriv := CreateOLEObject('Matlab.Autoserver.Single');
From: Ashish Uthama on
On Wed, 07 Apr 2010 11:00:15 -0300, Daniel <daniel.c.braun(a)web.de> wrote:

> "Ashish Uthama" <first.last(a)mathworks.com> wrote in message
> <op.vasn3ruba5ziv5(a)uthamaa.dhcp.mathworks.com>...
>> On Wed, 07 Apr 2010 10:23:07 -0300, Daniel <daniel.c.braun(a)web.de>
>> wrote:
>> > Hello,
>> > I want to use the COM Interface with a Delphi program but it doesn't
>> > work.
>> What happens instead?
>> > Do I need some special Toolboxes to use the interface?
>> > The dlls mwcomutil and mwcommgr aren't in my win32 folder. Also the
>> > mwregsvr.exe isn't there.
>> > Is it possible to invoke a COM Object without these data?
>> > I'm using Matlab 2007b.
>> >
>> > Thanks for any help.
>> >
>> > Regards
>> >
>> > Daniel
>> The interface is part of base MATLAB, it should work out of the box.
>> Try this if you have Excel installed, if it works, your MATLAB side
>> COM interface is allright:
>> >> hExcel = actxserver('excel.application') %open a COM interface to
>> Excel
>> hExcel =
>> COM.excel_application
>> >> hExcel.delete %close the connection
>
> Thanks for the quick response,
>
> I think I did explain the problem a little bit wrong. I don't want to
> start a program from matlab. I want to use the interface to start matlab
> in the background of my delphi program.
> But I get a german error message. In Englsih it means something like:
> Exception of the EOleSysError has occurred. Start of the server failed.
>
> I try to create the Matlab Object in Delphi with the command:
> MatlabObjPriv := CreateOLEObject('Matlab.Autoserver.Single');

Take a quick glance at (if you have not already)
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/brd0vd4-1.html
If you are familiar with VB you might want to give the simple example a
spin to ensure MATLAB is setup up.

Look at the regserver startup up option (to ensure that MATLAB is
registered as a COM server)
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabwindows.html
From: Daniel on
I tried the command

>> h = actxserver('matlab.application')
but got the error message

??? Error using ==> feval
Server Creation Failed

But the command hExcel = actxserver('excel.application') does work.

I added the path matlabroot/bin/win32 with: addpath

I tried to register the server in the Maltab command window and in a dos command window with: matlab regserver

In Matlab I get the error Message:
??? Undefined function or variable 'matlab'.
and in Dos I don't get any messages but it seems to do nothing.

I found the dlls mwcomutil and mwcomgr as well as the exe mwregsvr in a folder of a previously installations. I'm not sure where they come from. I moved them into the win32 folder of my current installation and tried to register them with
mwregsvr mwcomutil but then I got the message:
My Own Exception: Fatal error finding symbol mxGetProperty_700 in C:Prorgramme\Matlab2\R2007b\win32\lib.mx.dll Error:
Error: 0c0000045a Message: A DLL initialization failed.

And still I can't start a Matlab COM Object

I don't know what to do now.
Thanks for any help