#coding=utf-8
import threading
from ctypes import *
class DeviceAttribute(Structure):
_fields_ = [("vendorId", c_uint16),
("productId", c_uint16),
("deviceAddress", c_uint32),
("serialNumber", c_char * 64),
("uri", c_char * 255)]
class Device(Structure):
pass
deviceAttributeHandle = POINTER(DeviceAttribute)
deviceAttributeHandle_p = POINTER(deviceAttributeHandle)
dll = CDLL("./Nectaf.dll")
a = dll.Initialize()
if a!=0:
exit(1)
print("init ok")
deviceCount = c_int(0)
GetDeviceList = dll.GetDeviceList
GetDeviceList.argtypes = [deviceAttributeHandle_p,POINTER(c_int)]
GetDeviceList.restype = c_int
# pDeviceAttr = POINTER(POINTER(DeviceAttribute))
# dll.GetDeviceList(deviceAttributeHandle_p,byref(deviceCount))
deviceAttribute = deviceAttributeHandle()
# ret = getDeviceList(byref(self.deviceAttribute), byref(nCount))
dll.GetDeviceList(byref(deviceAttribute),byref(deviceCount))
print(deviceCount.value)
Read More:
- Error loading Python DLL ‘python36.dll’. LoadLibrary: The specified module could not be found.
- After the go pointer is declared and assigned, a panic: runtime error: invalid memory address or nil pointer reference appears
- Python calls DLL and reports an error windowserror: [error 126]
- Solve the problem of forward parameter req and resp parameter error
- Python error: importerror: DLL load failed: unable to find the specified module solution
- OpenCV3.1 + Python2.7 error “DLL load failed: The specified module could not be found”
- Using Visual Studio 2015 to create. DLL and use. DLL
- Start Tomcat and report an error: tcnative-1.dll: can’t load ia 32-bit. DLL on a amd 64 bit platform
- Python’s importerror: DLL load failed: the specified module was not found and the problem was solved
- Python import GDAL failed: DLL load failed. The specified module cannot be found.
- Windows10解决ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed
- Python how does a. Py file call classes and functions in another. Py file
- Solution to the error “tcnative-1.dll: can’t load amd 64 bit. DLL on IA 32 bit platform”
- Error in dev C + + running pointer
- How to use C + + function pointer array
- Python program uses OS. System () method to call exe program, resulting in no response of main program process
- ISO C++ forbids comparison between pointer and integer [-fpermissive]
- Free(): invalid pointer error when libtorch runs under Linux
- Solution to null pointer error in array
- Solve the interceptor calling service layer to display null pointer.