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 "<pyshell#4>", line 1, in <module> pp = byref(p) TypeError: byref() argument must be a ctypes instance, not 'CArgObject'
解决方法: