宝慕林4294392
给你一个例子看看,你就知道怎么做了C++的接口typedef struct{ unsigned long DeviceType; int Handle; int NumberOfClients; int SerialNumber; int MaxAllowedClients;}NeoDevice;int _stdcall icsneoFindNeoDevices(unsigned long DeviceTypes, NeoDevice *pNeoDevices, int *pNumberOfDevices);Python调用的代码:class NeoDevice(Structure): _fields_ = [("DeviceType",c_ulong), ("Handle",c_int), ("NumberOfClients",c_int), ("SerialNumber",c_int), ("MaxAllowedClients",c_int)]class cNeoVICan(CCanBase): def __init__(self): neoVi = windll.icsneo40 self.icsneoFindNeoDevices = neoVi.icsneoFindNeoDevicesif __name__ == "__main__": canBus = cNeoVICan() print canBus.icsneoGetDLLVersion() iNumberOfDevices = (NeoDevice * 10)() num = c_int() iResult = canBus.icsneoFindNeoDevices(c_ulong(65535), cast(iNumberOfDevices, POINT(NeoDevice)), byref(num))