How can I use Reflection to call a com made by matlab??

  • Thread starter Thread starter wenshere
  • Start date Start date
W

wenshere

I wrote such code:
Assembly asm = Assembly.LoadFrom(@"Tools.dll");
The Tools.dll is made by matlab, which contain some fuctions wrote in
matlab.
But it throws a System.BadImageFormatException!

How can I call that dll??
 
I wrote such code:
Assembly asm = Assembly.LoadFrom(@"Tools.dll");
The Tools.dll is made by matlab, which contain some fuctions wrote in
matlab.

The Load methods on the Assembly class are only for managed
assemblies, not for native DLLs.

How can I call that dll??

I don't know enough about Matlab to tell how the libraries work. BUt
if it's a regular Win32 DLL you may be able to use P/Invoke. (Search
the docs for Platform Invoke).


Mattias
 
Hi,

Beside of what Mattias said,
IIRC you posted about this a couple of days ago and somebody sent you a
link, it seems that in matlab you can create a COM object with your
functions. if so you need to add the reference to it , to go Project menu/
Add reference/ COM , then select browse and look for your dll ( or your
..tlb ) and the reference. once you get to this point you are ready to go :)


cheers,
 
Back
Top