本文整理汇总了C++中ThreadData::startThread方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadData::startThread方法的具体用法?C++ ThreadData::startThread怎么用?C++ ThreadData::startThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadData
的用法示例。
在下文中一共展示了ThreadData::startThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetStatus
int __cdecl CMsnProto::SetStatus(int iNewStatus)
{
if (m_iDesiredStatus == iNewStatus) return 0;
m_iDesiredStatus = iNewStatus;
MSN_DebugLog("PS_SETSTATUS(%d,0)", iNewStatus);
if (m_iDesiredStatus == ID_STATUS_OFFLINE)
{
if (msnNsThread)
msnNsThread->sendTerminate();
}
else if (!msnLoggedIn && m_iStatus == ID_STATUS_OFFLINE)
{
char szPassword[100];
int ps = getStaticString(NULL, "Password", szPassword, sizeof(szPassword));
if (ps != 0 || *szPassword == 0)
{
SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
return 0;
}
if (*MyOptions.szEmail == 0)
{
SendBroadcast(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
return 0;
}
sessionList.destroy();
dcList.destroy();
usingGateway = false;
int oldMode = m_iStatus;
m_iStatus = ID_STATUS_CONNECTING;
SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
ThreadData* newThread = new ThreadData;
newThread->mType = SERVER_NOTIFICATION;
newThread->mIsMainThread = true;
newThread->startThread(&CMsnProto::MSNServerThread, this);
}
else
if (m_iStatus > ID_STATUS_OFFLINE) MSN_SetServerStatus(m_iDesiredStatus);
return 0;
}