Re: calling ' extern "C" int __declspec(dllexport) ' declared functions?

RayS <[email protected]>
Newsgroups gmane.comp.python.ctypes
Message-ID <[email protected]>
At 06:51 PM 8/12/2010, Mark McMahon wrote:
># can you get a reference the DLL
>dll = ctypes.windll.YOURDLLNAME

yes, it also wasn't immediately obvious that it was a cdecl (which I 
used with partial sucess), not a windll

>Can you get references to the functions...
>SetBlockSize = dll.SetBlockSize  #using SetBlockSize is easier as 
>the argument is a plain int
>
>ret = SetBlockSize = SetBlockSize(123)

it returns zero (apparently OK, by the .h file comment)

># does ret have the return code for success (or expected return value?)
>
>For GetBlockSize - you will need to read the doc and see what to do 
>with pointer/reference values :)  (but usually ctypes.byref(var) or 
>ctypes.pointer(var) are what you need).

I tried both byref and pointer, but both returned -1; I'll be talking 
to the hardware maker tomorrow

Do you write Python code for AutoCAD?

Thanks,
Ray 


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.