[Pyrex] __stdcall calling conventions in Pyrex
Grant McDonald
gmcdonald at infocomp.com
Tue May 25 06:55:40 CEST 2004
Dear all,
I am currently using pyrex to wrap a C DLL that requires the use of
__stdcall calling conventions for any callback functions. To illustrate my
point:
cdef void comperr_callback(PPBORCA_COMPERR pCompErr, void *f):
test = {}
test['level'] = pCompErr.iLevel
test['line'] = pCompErr.iLineNumber
test['col'] = pCompErr.iColumnNumber
if pCompErr.lpszMessageNumber != NULL:
test['msg number'] = <LPSTR>pCompErr.lpszMessageNumber
else:
test['msg number'] = ''
if pCompErr.lpszMessageText != NULL:
test['msg text'] = <LPSTR>pCompErr.lpszMessageText
else:
test['msg text'] = ''
(<object>f)(test)
this callback requires the use of the __stdcall convention. The only
solution I have been able to come up with is to edit the pyrex-generated c
file to add the __stdcall directive to the function declarations. Is there
any way to make Pyrex include this directive in the generated file?
Regards,
Grant McDonald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20040525/d25066a1/attachment.html
More information about the Pyrex
mailing list