byref() argument must be a ctypes instance

sessionID = dll.QTTSSessionBegin(session_begin_params, byref(ret))

byref(n)返回的相当于C的指针右值&n,本身没有被分配空间:

>>> from ctypes import * >>> n = c_int(0) >>> p = byref(n) >>> pp = byref(p) Traceback (most recent call last):   File "", line 1, in     pp = byref(p) TypeError: byref() argument must be a ctypes instance, not 'CArgObject'

解决方法:

你可能感兴趣的:(python,Error,python,error,byref())