Re: [ctypes-users] python callind delphi
Brought to you by:
theller
From: Thomas H. <th...@py...> - 2004-06-29 18:29:53
|
"Donald L. Dietmeyer" <dl...@en...> writes: > I was given a lib_xx.so which I believe was written in Delphi, and > ask to prepare a Python wrapper. One thing lead to another which > eventually lead to ctpyes, which doesn't seem to do the job either. > I an testing with: > > > #!/usr/bin/python2 > # > # Lets make ctypes work with libBitLink > # > from ctypes import cdll > import os, sys > > libBL = cdll.LoadLibrary("/home/dld/bitlink/BitLinkLib/libBitLink.so") > > libBL.BS_Init() > f = libBL.BS_Open("TTY:/dev/ttys1") > print f > > libBL.BS_Send(f, "?") > print libBL.BS_Count(f) > > > BS_Open always returns 0, whether I supply a valid device or make > multiple calls on the same device. BS_Send apparently isn't > effective either, as Count always reveals that zero bytes are > being returned in response. > > Am I missing something? Suggestions? I cannot see anything wrong here, but what do I know about Delphi and it's calling conventions on *nix. I know that one guy called a Delphi dll on Windows, he had to pass the parameters in the reverse order. Maybe you can try that... Thomas |