Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calling a generic DLL without header file

275 views
Skip to first unread message

Iason Chatzakis

unread,
Jan 24, 2005, 2:53:14 PM1/24/05
to
Hello,

I have a piece of c++ code compiled into a .dll file. I need to
access this code from Matlab (v.7). I don't have a header file (.h)
accompanying the dll.

The dll loader ('loadlibrary') supported in Matlab v7.0 requires a
header file as well. Is there any way to by-pass that and use the dll
without having a header file?

thanks!

iason

Todd

unread,
Jan 24, 2005, 3:32:39 PM1/24/05
to
Regardless of whether you have a header or not, I believe LOADLIBRARY
only support libraries with a C interface. Check out the documentation at:

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/ch2_sha2.html#43202

However, if you do in fact have a C interface, check the documentation
on LOADLIBRARY carefully. Pay particular attention to the information
about a prototype M-file. It may be that you can write your own
prototype M-file based upon a few examples which you could generate from
some sample libraries and headers. DependencyWalker
(www.dependencywalker.com) may help you find which methods are exported
from your library as well.

Finally, you don't need the header that was used when the library was
created, you can simply write one which matches.

todd

Iason

unread,
Jan 25, 2005, 11:48:24 AM1/25/05
to
Thanks - especially DependencyWalker seems very helpful
0 new messages