S
Steve Simmons
PY33, Win7, Python Newbie, Not homework
I'm trying to use some 'C' DLLs from Python using ctypes and I have a
minor issue with the return valuesbut I am new to Python; ctypes and
using DLLs so I am at the bottom of so many learning curves, I'm not
sure where or how to find my mistake.
When I call the DLL, I am expecting a return of 1 (success) or a
negative number (one of a set of error conditions)the return value is
specified as 'short' in the DLL call specification - "short InitScanLib
(const char * szLicense)". What I get back is either a 1 or something
like 65535. This implies that I am receiving the expected value (-1)
but 'something' is being lost in the translation. The code is asper the
snippet below:
I've tried declaring initResult as c_short by: inserting...
.... before the call to sLib.InitScanLib but I still get the same
response (65535).
Interactively, I can see ...
It's not a critical issue because I only want the return value to
lookupa textual error message but I do want to understand what's going
on. Any input appreciated.
I'm trying to use some 'C' DLLs from Python using ctypes and I have a
minor issue with the return valuesbut I am new to Python; ctypes and
using DLLs so I am at the bottom of so many learning curves, I'm not
sure where or how to find my mistake.
When I call the DLL, I am expecting a return of 1 (success) or a
negative number (one of a set of error conditions)the return value is
specified as 'short' in the DLL call specification - "short InitScanLib
(const char * szLicense)". What I get back is either a 1 or something
like 65535. This implies that I am receiving the expected value (-1)
but 'something' is being lost in the translation. The code is asper the
snippet below:
I've tried declaring initResult as c_short by: inserting...
.... before the call to sLib.InitScanLib but I still get the same
response (65535).
Interactively, I can see ...
It's not a critical issue because I only want the return value to
lookupa textual error message but I do want to understand what's going
on. Any input appreciated.