1. functions inside a dll

When I use the file "freeImage.dll", the function (bellow) does not work with parameter: "FreeImage_GetFileType"

xfiGetFileType=registerw32Function(xfdFreeImage, "FreeImage_GetFileType", (C_POINTER, C_INT), C_INT)

The parameter "FreeImage_GetFileType" is exactly as indicated by the updated manual, which I copied from the Site freeimage.sourceforge.net. FreeImage.dll The file is also updated

I noticed that Tommy uses this parameter differently and works well. He uses this way: "_FreeImage_GetFileType @ 8"

In short, he put the characters "_" at the beginning and "@ 8" at the end of the parameter. And so it works well.

xfiGetFileType=registerw32Function(xfdFreeImage, "_FreeImage_GetFileType@8",(C_POINTER, C_INT), C_INT)

There are other functions in this DLL that are also not working, how can "guess" what characters have to put inside the parameters, to functions Work fine??

I'm playing wrong?

thanks, in advance.

new topic     » topic index » view message » categorize

2. Re: functions inside a dll

I think you must write '_' in the beginning and '@N' at the end, where N is size of parameters of the function in bytes.

new topic     » goto parent     » topic index » view message » categorize

3. Re: functions inside a dll

Have you tried dependency walker http://www.dependencywalker.com/?

new topic     » goto parent     » topic index » view message » categorize

4. Re: functions inside a dll

MichaelManturov said...

I think you must write '_' in the beginning and '@N' at the end, where N is size of parameters of the function in bytes.

This is exactly right. In fact, this is a result of name mangling caused by different calling conventions. See http://www.flounder.com/dynamicdll.htm

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu