Re: ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- From: Duncan Booth <duncan.booth@xxxxxxxxxxxxxxx>
- Date: 29 Jan 2009 13:44:45 GMT
alex <alecla@xxxxxxxxxx> wrote:
Joncdll is for importing functions which use the cdecl calling convention
Thank you for your answer. I tried it with no success.
However I tried with
tst=cdll.LoadLibrary("f:\\scratch\\test2\\footst.dll") instead of
tst=windll.LoadLibrary("f:\\scratch\\test2\\footst.dll")
and it runs now with no error message, I can't figure for now why, but
it's great! This is motivating for going ahead.
where the caller must clean up the stack.
windll is for functions that use the stdcall calling convention: the
function that is called is responsible for cleaning up the stack.
If you were using windll when you should have been using cdll then ctypes
will have been expecting the library to clean up the stack, and the library
will have been expecting the caller to do the cleanup, so nobody cleaned up
the stack.
The error message was telling you that ctypes pushed 4 bytes of argument
onto the stack which weren't popped off by the caller. If you had been
using the correct calling convention that would have indicated you had
passed too many arguments, but as you were using the wrong calling
convention the message was a bit unclear.
--
Duncan Booth http://kupuguy.blogspot.com
.
- Follow-Ups:
- References:
- ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- From: alex
- Re: ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- From: Jon Clements
- Re: ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- From: alex
- ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- Prev by Date: Re: how to update python on gnu emacs?
- Next by Date: Re: is python Object oriented??
- Previous by thread: Re: ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- Next by thread: Re: ctypes with Compaq Visual Fortran 6.6B *.dll (Windows XP), passing of integer and real values
- Index(es):
Relevant Pages
|