首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

调用dll 发生溢出?解决办法

2012-03-03 
调用dll 发生溢出?原C++头C/C++ codeNET_DVR_API LONG __stdcall NET_DVR_RealPlay_V30(LONG lUserID, LPN

调用dll 发生溢出?
原C++头

C/C++ code
NET_DVR_API LONG __stdcall NET_DVR_RealPlay_V30(LONG lUserID, LPNET_DVR_CLIENTINFO lpClientInfo, void(CALLBACK *fRealDataCallBack_V30) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, void* pUser) = NULL, void* pUser = NULL, BOOL bBlocked = FALSE); 



改为VB模块声明:

VB code
Public Declare Function NET_DVR_RealPlay_V30 Lib "HCNETSDK.dll" (lUserID As Long, ByRef lpClientInfo As LPNET_DVR_CLIENTINFO, ByVal pProc As Long, ByRef pUser As Any, ByVal bBlocked As Boolean) As LongPublic Declare Function fRealDataCallBack_V30 Lib "HCNETSDK.dll" (ByVal lRealHandle As Long, ByVal dwDataType As Long, ByRef pBuffer As Byte, ByVal dwBufSize As Long, ByRef pUser As Any)




调用

VB code
Dim clientinfo As LPNET_DVR_CLIENTINFO clientinfo.lChannel = 2                '; // 通道号clientinfo.lLinkMode = 0               ';clientinfo.sMultiCastIP = "234.5.6.7"  '; lRealHandle = NET_DVR_RealPlay_V30(lUserID, clientinfo, Null, 1, False)


运行后最后一段错误... "实时错误94,无效使用NULL"

估计是第3个参数的问题.请问解决方法.


[解决办法]
重要的两处LPNET_DVR_CLIENTINFO的定义你怎么没贴出来呢

热点排行