Board index » off-topic » How to call a CPP DLL from Tasm ?

How to call a CPP DLL from Tasm ?


2007-08-15 03:46:38 AM
off-topic17
Hello All,
I have (again) ran into a problem : I'm trying to use CPP-style
FreeImage.DLL ( freeimage.sourceforge.net/sourcecode.html ), but
can't seem to actually do that. :-\
Either I get an error-message while assembling the file, or I get an error
while running the program (for a non-existing function).
I generated the LIB with IMPLIB -f -c , and extracted the function-names
names from the output of TDUMP.
The function-name I started with and is (allready) giving me troubles is
defined as "_FreeImage_GetVersion PROCDESC CPP". This assembles o.k., but
the resulting executable can't find the function. This sounds logical, as
its named "_FreeImage_GetVersion@0" in the DLL itself (not in the LIB !).
What am I doing wrong here ?
Regards,
Rudy Wieser
 
 

Re:How to call a CPP DLL from Tasm ?

Try this:
Do this to create a module definition file
impdef dllname.def dllname.dll
In the exports section of dllname.def put a line like this
_FreeImage_GetVersion = _FreeImage_GetVersion@0
Now either use the module definition file in the link or create an import
library from it with implib and use it:
implib -c dllname.lib dllname.def
. Ed
Quote
R.Wieser wrote in message
news:46c2067e$ XXXX@XXXXX.COM ...

I have (again) ran into a problem : I'm trying to use CPP-style
FreeImage.DLL ( freeimage.sourceforge.net/sourcecode.html ), but
can't seem to actually do that. :-\

Either I get an error-message while assembling the file, or I get an error
while running the program (for a non-existing function).

I generated the LIB with IMPLIB -f -c , and extracted the function-names
names from the output of TDUMP.

The function-name I started with and is (allready) giving me troubles is
defined as "_FreeImage_GetVersion PROCDESC CPP". This assembles o.k.,
but
the resulting executable can't find the function. This sounds logical, as
its named "_FreeImage_GetVersion@0" in the DLL itself (not in the LIB !).

What am I doing wrong here ?
 

Re:How to call a CPP DLL from Tasm ?

Ed Mulroy [TeamB] < XXXX@XXXXX.COM >schreef in berichtnieuws
46c214d8$ XXXX@XXXXX.COM ...
Quote
Try this:
<Snip>
Quote
In the exports section of dllname.def put a line like this
_FreeImage_GetVersion = _FreeImage_GetVersion@0
That is something I did not think of ...
Thanks,
Rudy Wieser
 

{smallsort}