473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

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??
Nov 17 '05 #1
2 2602
>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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 17 '05 #2
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"wenshere" <we******@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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??

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mathias | last post by:
Dear NG, I currently ty to switch from matlab to python/scipy but have a lot of trouble with images. What I need is a function for subsequently displaying a number of 2D-matrices as an image. I...
0
by: sdhyok | last post by:
PyMat enables to call matlab functions from python. But, what I want is to call python functions from matlab. Is there any library for it? Thanks. Daehyok Shin
6
by: Laser Lu | last post by:
HI, all, I just want to invoke an internal method named 'ResolveClientUrl', which is defined in class System.Web.UI.Control, using an instance object of a type that derives from Control. Let's...
0
by: James Hadwen | last post by:
Hi, I'm trying to do something with reflection that's a little wierd. The idea is that I call for a field to be updated on a base class. Using reflection it first updates the value, and then...
0
by: torarvid | last post by:
Hello, I am trying to write a search function that will search through given properties in all objects of a given type for a given phrase, like so: ICollection Search( Type type, string...
6
by: Lars Christiansen | last post by:
Hi! I am a master student in (geo)physics at the University of Copenhagen and part of a study group on C++ as a scientific programming language. I, and the other students in the group, have...
2
by: Jay12345 | last post by:
Hello friends, I am new to both VB6.0 and MatLab. Can anyone guide me on how to call a MatLab executable from VB6.0? i.e. I want to call a program written in MatLab(executable) from a VB6.0...
1
by: chitralaxman | last post by:
Sir, I'm a M. E (comuter Science and Engineering) Student and now i'm doing my project in Bioinformatics. I'm new to perl & MATLab. I've written the code for neural network simulation in MATLab....
14
by: Luna Moon | last post by:
Dear all, Can C++/STL/Boost do the vectorized calculation as those in Matlab? For example, in the following code, what I really want to do is to send in a vector of u's. All other...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.