-
示例代码:一个远程设备维护模块在CATIA V5零件库中的应用
资源介绍
4.5 远程设备维护模块的示例代码
相关模块流程图
日志查询
#include
#include
#include "Windows.h"
#include "HCNetSDK.h"
using namespace std;
void main() {
//---------------------------------------
// 初始化
NET_DVR_Init();
//设置连接时间与重连时间
NET_DVR_SetConnectTime(2000, 1);
NET_DVR_SetReconnect(10000, true);
//---------------------------------------
// 注册设备
LONG lUserID;
NET_DVR_DEVICEINFO_V30 struDeviceInfo;
lUserID = NET_DVR_Login_V30("192.0.0.64", 8000, "admin", "12345", &struDeviceInfo);
if (lUserID < 0)
{
printf("Login error, %d\n", NET_DVR_GetLastError());
NET_DVR_Cleanup();
return;
}
NET_DVR_TIME struStartTime, struStopTime;
struStartTime.dwYear = 2011;
struStartTime.dwMonth = 3;
struStartTime.dwDay = 2;
struStartTime.dwHour = 9;
struStartTime.dwMinute = 0;
struStartTime.dwSecond =0;
struStopTime.dwYear = 2011;
struStopTime.dwMonth = 3;
struStopTime.dwDay = 2;