本文整理汇总了C++中CInterface::SMT_GetAllInitBlackList方法的典型用法代码示例。如果您正苦于以下问题:C++ CInterface::SMT_GetAllInitBlackList方法的具体用法?C++ CInterface::SMT_GetAllInitBlackList怎么用?C++ CInterface::SMT_GetAllInitBlackList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInterface
的用法示例。
在下文中一共展示了CInterface::SMT_GetAllInitBlackList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SMT_EveryDayGetAllInitAssistantThread
/*=================================================================
* Function ID : SMT_EveryDayGetAllInitAssistantThread
* Input : void
* Output : void
* Author :
* Date : 2009 8
* Return : void
* Description : 主线程(定时获取黑名单)12小时
* Notice :
*
*=================================================================*/
UINT SMT_EveryDayGetAllInitAssistantThread( LPVOID pParam )
{
DWORD nDStartTime=GetTickCount();
int FunId;
int updata1=0;
int updata2=0;
time_t rawtime;
struct tm * timeinfo;
try
{
while( g_StartFlag )
{
time ( &rawtime );
timeinfo = localtime ( &rawtime );
//执行设置黑名单更新时间1
if ((timeinfo->tm_hour == g_IniFilePara.DownBlacktime1) && (updata1!=timeinfo->tm_mday))
{
FunId=SMT_SMARTFRONTDOWNALLBLACK_EVERYDAY;
g_CInterface.SMT_GetAllInitBlackList(FunId);
updata1=timeinfo->tm_mday;
}
//执行设置黑名单更新时间2
if ((timeinfo->tm_hour == g_IniFilePara.DownBlacktime2) && (updata2!=timeinfo->tm_mday))
{
FunId=SMT_SMARTFRONTDOWNALLBLACK_EVERYDAY;
g_CInterface.SMT_GetAllInitBlackList(FunId);
updata2=timeinfo->tm_mday;
}
}
}
catch(...)
{
((CSmartCommunicationDlg*)pParam)->WriteLog("调用金仕达接口时出现异常,前置自动停止运行!!");
MessageBox(NULL,"调用金仕达接口时出现异常,前置自动停止运行!!","严重错误",MB_OK);
((CSmartCommunicationDlg*)pParam)->OnButtonStop();
}
return 0;
}
示例2: OnButtonStart
void CSmartCommunicationDlg::OnButtonStart()
{
char buf[128],Module[30],msg[256];
CData mdata;
int nErrCode=0;
int FunId;
CSystemInfo SystemInfo;
list<CSocketSmart>::iterator SocketSmart;
memset(buf, 0x00,sizeof buf);
memset(msg, 0x00,sizeof msg);
memset(Module,0x00,sizeof Module);
g_CInterface.SetParentpDlg(this);
//清除显示框中的信息
OnButtonClear();
Init();
m_BtCancel.EnableWindow(FALSE);
m_BtStart.EnableWindow(FALSE);
m_BtClear.EnableWindow(TRUE);
strcpy(msg,"前置系统开始启动并监控所有终端设备,请稍后......");
AddString(msg);
WriteLog(msg);
//初始化第三方接口
strcpy(msg,"前置系统正在初始化第三方接口,请稍后......");
AddString(msg);
WriteLog(msg);
if( !g_bInitConnectFlag )
{
if( !g_CInterface.SMT_InterfaceInit(m_ServerIP,m_ServerPort) )
{
AddString("前置系统正在初始化第三方接口失败,请退出前置重新启动");
strcpy(m_ErrMsg,g_CInterface.m_szText);
goto To_SystemEnd;
}
g_bInitConnectFlag=true;
}
//前置签到
strcpy(msg,"前置系统正在向金仕达签到,请稍后......");
AddString(msg);
WriteLog(msg);
if( !g_CInterface.SMT_SmartFrontLogin(5000) )
{
sprintf(m_ErrMsg,"前置向金仕达签到失败[金仕达返回:%s]",g_CInterface.m_szText);
goto To_SystemEnd;
}
//获取黑名单
strcpy(msg,"前置系统正在装载黑名单,请稍后......");
AddString(msg);
WriteLog(msg);
FunId=SMT_SMARTFRONTDOWNALLBLACK;
if( !g_CInterface.SMT_GetAllInitBlackList(FunId) )
{
strcpy(m_ErrMsg,g_CInterface.m_szText);
goto To_SystemEnd;
}
//获取补助名单
strcpy(msg,"前置系统正在装载补助名单,请稍后......");
AddString(msg);
WriteLog(msg);
if( !g_CInterface.SMT_GetAllInitAssistantList(false,0) )
{
strcpy(m_ErrMsg,g_CInterface.m_szText);
goto To_SystemEnd;
}
//获取设备的主参数
strcpy(msg,"前置系统正在获取设备的主参数,请稍后......");
AddString(msg);
WriteLog(msg);
if( !GetDevicePara() )
{
strcpy(m_ErrMsg,g_CInterface.m_szText);
goto To_SystemEnd;
}
//显示启动的服务总数
sprintf(m_ErrMsg,"前置系统总共需要启动%ld个链路服务.",g_LTcpsmart.size());
AddString(m_ErrMsg);
WriteLog(m_ErrMsg);
//启动所有通过TCP连接的服务
for( SocketSmart=g_LTcpsmart.begin();SocketSmart!=g_LTcpsmart.end();SocketSmart++)
{
SocketSmart->SetParent(this);
SocketSmart->Start();
sprintf(m_ErrMsg,"开始准备启动 %s 的线程......",SocketSmart->m_IpPar.cIPAddress);
AddString(m_ErrMsg);
WriteLog(m_ErrMsg);
}
g_StartFlag = 1;
//取任务线程
UINT SMT_StartQueryTaskThread( LPVOID pParam );
if(AfxBeginThread(SMT_StartQueryTaskThread, (LPVOID)this)==NULL)
{
strcpy(m_ErrMsg,"创建从数据库中取任务的线程失败");
goto To_SystemEnd;
}
//.........这里部分代码省略.........