why ctypes+dll gives a strange result

oyster lepto.python at gmail.com
Sun Nov 11 12:21:25 CET 2007


you can download the files at
http://www.newsmth.net/att.php?s.284.38015.655.zip
the dll and exe are created by freebasic

import ctypes
mydll=ctypes.windll.LoadLibrary("mydll.dll")

_TwoTimes=getattr(mydll,'TWOTIMES at 8')
_TwoTimes.argtypes=[ctypes.c_double]
def TwoTimes(i):
        return _TwoTimes(i)

in fact, twotimes function return double*2, but when I use
print TwoTimes(10)
in python, I get 2226880

thanx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071111/181a9eb3/attachment.html>


More information about the Python-list mailing list