Steve Simmons <square.st...@gmail.com> wrote: > >>> from ctypes import * > >>> sLib = cdll.slib > >>> lic_key = c_char_p("asdfghjkl".encode(encoding='utf_8', > errors='strict')) > >>> initResult = sLib.InitScanLib(lic_key.value) > >>> print("InitScanLib Result: ", initResult) > InitScanLib Result: 65535 > >>> > > I've tried declaring initResult as c_short by: inserting... > > >>> initResult = c_short(0) > > ... before the call to sLib.InitScanLib but I still get the same > response (65535).
Tell the function what type to return before you call it: InitScanLib = sLib.InitScanLib InitScanLib.restype = c_short See http://docs.python.org/2/library/ctypes.html#return-types You can also tell it what parameter types to expect which will make calling it simpler. -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list