Re: WindowsXP / CTypes Module - unable to access function in a dll

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dudeja.rajat@gmail.com

    Re: WindowsXP / CTypes Module - unable to access function in a dll

    On Tue, Aug 19, 2008 at 11:04 AM, <dudeja.rajat@g mail.comwrote:
    Hi,
    >
    I'm using the CTYPES module of python to load a dll. My dll contains a
    Get_Version function as:
    long __stdcall af1xEvdoRDll_Ge tVersion(long version[4]);
    >
    This function accepts a long array of 4 elements.
    >
    Following is the python code I've written:
    >
    from ctypes import *
    abc = windll.af1xEvdo RDll
    GetVersion = abc.af1xEvdoRDl l_GetVersion
    print GetVersion
    versionArr = c_long * 4 #array of 4 longs
    version = versionArr(0, 0, 0, 0) # initializing all elements to 0
    GetVersion(vers ion) #calling dll function
    print version
    >
    I'm getting the following output:
    <_FuncPtr object at 0x00A1EB70>
    <__main__.c_lon g_Array_4 object at 0x00A86300>
    >
    But I'm not getting the desired output which I expect as : 2.1.5.0
    >
    >
    Please suggest what am I missig?
    >
    Sorry, the problem is resolved. The code in fact is correct and I got
    the right answers. It is just that I was not priting results in a
    right manner.
    I added : print i in version : print i

    this solved my problem.

    Cheers.
Working...