473,399 Members | 3,401 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,399 software developers and data experts.

ctypes, accessing uInt32 and pointer to uInt32

I am taking the first steps letting python access a c-function in a
..dll-file, but need some help getting it right. WHat am I missing?

---------------------------------
# Trying to access c-code placed in a DLL:
# void __stdcall F_to_C(uInt32 DegF, uInt32 *DegC);

from ctypes import *
Convert_Temp=cdll.LoadLibrary("h:/WorkingWith/PythonDLL/Convert_Temp.dll")
fahr=c_int(52)
deg=c_int()
Convert_Temp.F_to_C(fahr, byref(deg))
cdll.free_library (ConvertTemp)
----------------------------------

But the result I get is:

ValueError: Procedure called with not enough arguments (8 bytes
missing) or wrong calling convention

on the call to ConvertTemp.

If I set fahr and deg to c_long it runs but I get WindowsError:
exception: access violation writing 0x00000000
Thank you for reading..

/Andy

--
All people are equal, but some are more equal that the others
- Someone more equal
But we all are told that we differ??
- Me..
Jul 18 '05 #1
0 1535

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

Similar topics

3
by: Lenard Lindstrom | last post by:
Posted in a previous thread was some Python code for accessing Window's Simple MAPI api using the ctypes module. http://groups-beta.google.com/group/comp.lang.python/msg/56fa74cdba9b7be9 This...
12
by: p.lavarre | last post by:
Q: The C idea of (pv != NULL) is said most directly in Python ctypes how? A: We are of course supposed to write something like: def c_not_null(pv): return (ctypes.cast(pv,...
1
by: sjdevnull | last post by:
Hey, I'm trying to wrap GNU readline with ctypes (the Python readline library doesn't support the callback interface), but I can't figure out how to set values to a variable inside the library. ...
7
by: =?Utf-8?B?U3RlcGhhbmllIERvaGVydHk=?= | last post by:
I am trying to call some API functions written in C++ from my VB .NET 2003 application and am running into some difficulty in passing structures to a function. It is probably due to the types I'm...
5
by: Daniel | last post by:
I'm trying to implement a routine that converts a PDF document to image files using ctypes and the Apple CoreGraphics library as per the 'Splitting a PDF File' example on Apple's web site ....
0
by: wizkid | last post by:
hi everyone.. Im having trouble in accessing an api from c++ dll using c# platform.. I would like to retreive data from this api... I think im lost pls help me... //this is the api created from...
6
by: Jack | last post by:
I'm not able to build IP2Location's Python interface so I'm trying to use ctypes to call its C interface. The functions return a pointer to the struct below. I haven't been able to figure out how...
2
by: Jean-Paul Calderone | last post by:
On Mon, 30 Jun 2008 09:13:42 -0700 (PDT), gianluca <geonomica@gmail.comwrote: POINTER takes a class and returns a new class which represents a pointer to input class. pointer takes an instance...
14
by: Gordon Allott | last post by:
Hello :) The result of various incompatibilities has left me needing to somehow extract the address that a null pointer is pointing to with the null pointer being exposed to python via...
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
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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.