473,382 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

On Tue, Aug 19, 2008 at 11:04 AM, <du**********@gmail.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_GetVersion(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.af1xEvdoRDll
GetVersion = abc.af1xEvdoRDll_GetVersion
print GetVersion
versionArr = c_long * 4 #array of 4 longs
version = versionArr(0, 0, 0, 0) # initializing all elements to 0
GetVersion(version) #calling dll function
print version

I'm getting the following output:
<_FuncPtr object at 0x00A1EB70>
<__main__.c_long_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.
Aug 19 '08 #1
0 1020

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: zapazap | last post by:
Dear Snake Charming Gurus, (Was: http://mail.python.org/pipermail/python-list/2004-January/204454.html) First, a thank you to Tim Golden, Thomas Heller, and Mark Hammond for your earlier help...
1
by: Thomas Heller | last post by:
ctypes 0.9.1 released - Sept 14, 2004 ===================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call...
6
by: Mudcat | last post by:
Hi, I can't figure out why ctypes won't load the DLL I need to use. I've tried everything I can find (and the ctypes website is down at the moment). Here's what I've seen so far. I've added...
0
by: Egor Zindy | last post by:
Egor Zindy wrote: #!/usr/bin/env python """ A generic chipid library based on ctypes This module handles most of the functions in FTChipID.dll
5
by: castironpi | last post by:
Hi all, I have a mmap and a data structure in it. I know the structure's location in the mmap and what structure it is. It has a ctypes definition. I want to initialize a ctypes object to...
1
by: dudeja.rajat | last post by:
Hi, I'm using the CTYPES module of python to load a dll. My dll contains a Get_Version function as: long __stdcall af1xEvdoRDll_GetVersion(long version); This function accepts a long array of...
0
by: Fredrik Lundh | last post by:
dudeja.rajat@gmail.com wrote: expecting that Python/ctypes should be able to figure out that you want an array of 4 integers printed as a dot-separated string is a bit optimistic, perhaps. ...
0
by: dudeja.rajat | last post by:
Hi, I've used CTYPES module to access a function from a dll. This function provides me the version of the dll. This information is accessible to me as an array of 4 long inetegers. information...
0
by: dudeja.rajat | last post by:
On Tue, Aug 19, 2008 at 12:20 PM, Fredrik Lundh <fredrik@pythonware.comwrote: Fredrik, My apology for any confusion created. I read all the replies. In fact I'm thankful to you all guys who are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.