Public Type MV_CC_DEVICE_INFO '设备信息结构体
nMajorVer As Integer '主要版本
nMinorVer As Integer '次要版本
nMacAddrHigh(3) As Byte '高MAC地址
nMacAddrLow(3) As Byte '低MAC地址
nTLayerType As Long '设备传输层协yi类型
nReserved(3) As Long '预留
SpecialInfo(539) As Byte '所有设备信息联合体
End Type
Public Type MV_CC_DEVICE_INFO_LIST '设备信息结构体
nDeviceNum As Long '设备数量
pDeviceInfo(255) As Long '设备信息
End Type
打开相机原VB代码如下: Dim stDeviceInfo As MV_CC_DEVICE_INFO Dim pStDeviceInfo As Long
Dim nRet As Long
Dim m_pHandle As Long
Dim m-handle As long
Dim m_stDevList As MV_CC_DEVICE_INFO_LIST
m_pHandle = VarPtr(m_handle)
nRet = MV_CC_CreateHandle(m_pHandle, pStDeviceInfo)
If nRet <> 0 Then
MsgBox ("MV_CC_CreateHandle error")
Exit Sub
End If
nRet = MV_CC_OpenDevice(m_pHandle, 1, 0)