calling loaded DLL function expecting POINT * argument

Tim Williams tjandacw at cox.net
Tue Sep 4 09:05:20 EDT 2012


On Tuesday, September 4, 2012 8:16:33 AM UTC-4, Tim Williams wrote:
> On Sunday, August 26, 2012 9:23:49 PM UTC-4, Tim Roberts wrote:
> 
> > Tim Williams <tjandacw at cox.net> wrote:
> 
> > 
> 
> > 
> 
> > 
> 
> > >Hello all,
> 
> > 
> 
> > >
> 
> > 
> 
> > >I'm trying to use the ctypes module to call functions in a DLL. I've
> 
> > 
> 
> > >figured out how to modify my path so the library is found, and I can 
> 
> > 
> 
> > >call LoadLibrary on it, but one of the functions expects an array of
> 
> > 
> 
> > > POINTS. Here is the prototype from the .h file:
> 
> > 
> 
> > >
> 
> > 
> 
> > >
> 
> > 
> 
> > >TRACKER_API HRESULT InitializeMask(HANDLE pHandle, int nWidth, int nHeight, POINT* ptMasks, int nNumPoints);
> 
> > 
> 
> > 
> 
> > 
> 
> > How is TRACKER_API defined?  You're using ctypes.oledll, which uses the
> 
> > 
> 
> > __stdcall calling convention.  It's possible your DLL is defined as
> 
> > 
> 
> > __cdecl.  Try cdll.LoadLibrary instead of oledll.LoadLibrary.
> 
> > 
> 
> > -- 
> 
> > 
> 
> > Tim Roberts, timr at probo.com
> 
> > 
> 
> > Providenza & Boekelheide, Inc.
> 
> 
> 
> Thanks for the reply. I've been out all last week. I'll give it a try.

cdll.LoadLibrary did trick! Thanks again. Now on to the next step....



More information about the Python-list mailing list