海康NET_DVR_GetDVRConfig VB参数传递
SDK信息:NET_DVR_GetDVRConfig
获取设备的配置信息。
BOOL NET_DVR_GetDVRConfig(
LONG lUserID,
DWORD dwCommand,
LONG lChannel,
LPVOID lpOutBuffer,
DWORD dwOutBufferSize,
LPDWORD lpBytesReturned
);
Parameters
lUserID
[in] NET_DVR_Login或NET_DVR_Login_V30的返回值
dwCommand
[in] 设备配置命令,参见配置命令
lChannel
[in] 通道号或者组号,如果命令不需要通道号或者组号,该参数无效,置为0xFFFFFFFF即可
lpOutBuffer
[out] 接收数据的缓冲指针
dwOutBufferSize
[in] 接收数据的缓冲长度(以字节为单位),不能为0
lpBytesReturned
[out] 实际收到的数据长度指针,不能为NULL
dwCommand宏定义 dwCommand含义 lChannel lpOutBuffer对应结构体 宏定义值
NET_DVR_GET_IPPARACFG_V40 获取IP接入配置参数 有效 NET_DVR_IPPARACFG_V40 1062
NET_DVR_IPPARACFG_V40
IP设备资源及IP通道资源配置结构体。
struct{
DWORD dwSize;
DWORD dwGroupNum;
DWORD dwAChanNum;
DWORD dwDChanNum;
DWORD dwStartDChan;
BYTE byAnalogChanEnable[MAX_CHANNUM_V30];
NET_DVR_IPDEVINFO_V31 struIPDevInfo[MAX_IP_DEVICE_V40];
NET_DVR_STREAM_MODE struStreamMode[MAX_CHANNUM_V30];
BYTE byRes2[20];
}NET_DVR_IPPARACFG_V40, *LPNET_DVR_IPPARACFG_V40;
Members
dwSize
结构体大小
dwGroupNum
设备支持的总组数(只读)。若设备支持的组数大于1,NET_DVR_GetDVRConfig(或者NET_DVR_SetDVRConfig)获取(或设置)相关通道参数需要按照组数调用多次命令分别获取(或设置)各组通道参数,此时接口中lChannel对应组号。
dwAChanNum
最大模拟通道个数(只读)
dwDChanNum
数字通道个数(只读)
dwStartDChan
起始数字通道(只读)
byAnalogChanEnable
模拟通道资源是否启用,从低到高表示1-64通道:0-禁用,1-启用。
struIPDevInfo
IP设备信息,下标0对应设备IP ID为1
struStreamMode
取流模式
byRes2
保留,置为0
我的方法:
'获取参数大配置接口(NET_DVR_GetDVRConfig)
Public Declare Function NET_DVR_GetDVRConfig Lib "HCNETSDK.dll" ( _
ByVal lUserID As Long, _
ByVal dwCommand As Long, _
ByVal lChannel As Long, _
lpOutBuffer As Any, _
ByVal dwOutBufferSize As Long, _
ByRef dwReturned As Long) As Long
'IP设备资源及IP通道资源配置结构体
Type NET_DVR_IPPARACFG_V40
dwSize As Long
dwGroupNum As Long
dwAChanNum As Long
dwDChanNum As Long
dwStartDChan As Long
byAnalogChanEnable As Byte
struIPDevInfo As NET_DVR_IPDEVINFO_V31
struStreamMode As NET_DVR_STREAM_MODE
byRes2(20) As Byte
End Type
Dim dwReturned As Long
NET_DVR_GetDVRConfig(UserID, 1062, 0, NET_DVR_IPPARACFG_V40, LenB(NET_DVR_IPPARACFG_V40), dwReturned)
总是错误:NET_DVR_PARAMETER_ERROR 17 参数错误。SDK接口中给入的输入或输出参数为空
请指教,^_^