473,398 Members | 2,188 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,398 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 1021

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...
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: 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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.