functions with: char & type of parameters
Pavel Nikitenko <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
I am trying to call following C function from Windows DLL from Python
with ctypes.
int __stdcall BBBOUNCECHECK( char &strMessage,
char &strAddressOut,
int &lAddressLenOut,
char &strEmailIgnoreList,
char &strKey
);
I tried the following:
pEmailAddress = create_string_buffer(255)
emailAddressLength = c_long(0)
returnValue = self.bBounceDLL.BBBOUNCECHECK(emailMessage,
pEmailAddress, byref(emailAddressLength), self.excludeList,
self.licenseKey);
self.emailAddress = repr(pEmailAddress.value)
return returnValue
But it looks like it does not work. It returns completely different
results in comparison if I call the same DLL function from .NET C#.
It looks like there is a problem with: char & function type parameters.
In all examples on Internet I see that for ctypes to call DLL function
is there used mostly char *.
Could somebody advice, how to correctly call functions with: char & type
of parameters, with ctypes from python? I do not see it in ctypes
documentation at all.
Pavel
------------------------------------------------------------------------------