[ctypes-users] problem on call a dll
Brought to you by:
theller
From: Michele P. <mic...@un...> - 2006-04-27 18:10:16
|
Hi list, I'm trying to call the freetype (freetype.org) dll with ctypes, but I have some problems on my win platform. I create a little wrapper for the freeimage library that work well on linux, but on win I receive: File "V:\dev\FreeTypePy_h.py", line 599, in __init__ print self.lib.FT_Init_FreeType (C.addressof(library)) ValueError: Procedure probably called with too many arguments (4 bytes in excess) Like I said, the same code work on linux! The dll that I'm using is that found on gnuwin32.sf.net on the freetype section. The developer, that I wrote to, said that this problem derive from the compiler and the calling conversion. So, for try, I made a simple "C -> C++" dll wrapper like this: -------dllmain.c #include <ft2build.h> #include FT_FREETYPE_H #define DLL_API extern "C" __declspec(dllexport) #define DLL_CALLCONV __stdcall DLL_API FT_Error DLL_CALLCONV initLib(FT_Library *library) { return FT_Init_FreeType( library ); } DLL_API FT_Error DLL_CALLCONV doneLib(FT_Library library) { return FT_Done_FreeType( library ); } And compiled with g++.exe to project.dll And now if I call the "project.dll", I can call the freetype.dll! What can I do for try to make all work? Thanks, Michele |