1. functions inside a dll
- Posted by SergioGelli Jul 30, 2010
- 1682 views
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.
2. Re: functions inside a dll
- Posted by MichaelManturov Jul 30, 2010
- 1651 views
I think you must write '_' in the beginning and '@N' at the end, where N is size of parameters of the function in bytes.
3. Re: functions inside a dll
- Posted by petelomax Jul 30, 2010
- 1639 views
Have you tried dependency walker http://www.dependencywalker.com/?
4. Re: functions inside a dll
- Posted by jimcbrown (admin) Jul 30, 2010
- 1621 views
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