本文整理汇总了C++中ForkThread函数的典型用法代码示例。如果您正苦于以下问题:C++ ForkThread函数的具体用法?C++ ForkThread怎么用?C++ ForkThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ForkThread函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForkThread
INT_PTR FacebookProto::RefreshBuddyList(WPARAM, LPARAM)
{
if (!isOffline()) {
facy.client_notify(TranslateT("Refreshing buddy list..."));
ForkThread(&FacebookProto::ProcessBuddyList, NULL);
}
return 0;
}
示例2: ForkThread
MCONTACT TwitterProto::AddToList(int, PROTOSEARCHRESULT *psr)
{
if (m_iStatus != ID_STATUS_ONLINE)
return 0;
ForkThread(&TwitterProto::AddToListWorker, mir_utf8encodeT(psr->nick.t));
return AddToClientList(_T2A(psr->nick.t), "");
}
示例3: InterlockedIncrement
int FacebookProto::SendMsg(MCONTACT hContact, int, const char *msg)
{
std::string message = msg;
unsigned int msgId = InterlockedIncrement(&facy.msgid_);
ForkThread(&FacebookProto::SendMsgWorker, new send_direct(hContact, message, msgId));
return msgId;
}
示例4: InterlockedIncrement
int TwitterProto::SendMsg(MCONTACT hContact, int, const char *msg)
{
if (m_iStatus != ID_STATUS_ONLINE)
return 0;
int seq = InterlockedIncrement(&g_msgid);
ForkThread(&TwitterProto::SendSuccess, new send_direct(hContact, msg, seq));
return seq;
}
示例5: mir_tstrdup
HANDLE FacebookProto::SearchByEmail(const PROTOCHAR* email)
{
if (isOffline())
return 0;
TCHAR *temail = mir_tstrdup(email);
ForkThread(&FacebookProto::SearchAckThread, temail);
return temail;
}
示例6: MSN_GenRandom
HANDLE __cdecl CMsnProto::GetAwayMsg(HANDLE hContact)
{
AwayMsgInfo* inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo));
inf->hContact = hContact;
inf->id = MSN_GenRandom();
ForkThread(&CMsnProto::MsnGetAwayMsgThread, inf);
return (HANDLE)inf->id;
}
示例7: mir_tstrdup
HANDLE __cdecl CMsnProto::SearchBasic(const PROTOCHAR* id)
{
if (!msnLoggedIn) return 0;
TCHAR* email = mir_tstrdup(id);
ForkThread(&CMsnProto::MsnSearchAckThread, email);
return email;
}
示例8: ForkThread
HANDLE __cdecl CAimProto::SearchBasic(const PROTOCHAR* szId)
{
if (state != 1)
return 0;
//duplicating the parameter so that it isn't deleted before it's needed- e.g. this function ends before it's used
ForkThread(&CAimProto::basic_search_ack_success, mir_t2a(szId));
return (HANDLE)1;
}
示例9: MSN_GetAvatarFileName
INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam)
{
TCHAR* szFileName = (TCHAR*)lParam;
TCHAR tFileName[MAX_PATH];
MSN_GetAvatarFileName(NULL, tFileName, _countof(tFileName), NULL);
_tremove(tFileName);
if (szFileName == NULL) {
delSetting("PictObject");
delSetting("AvatarHash");
ForkThread(&CMsnProto::msn_storeAvatarThread, NULL);
}
else {
int fileId = _topen(szFileName, _O_RDONLY | _O_BINARY, _S_IREAD);
if (fileId < 0) return 1;
size_t dwPngSize = _filelengthi64(fileId);
unsigned char* pData = (unsigned char*)mir_alloc(dwPngSize);
if (pData == NULL) {
_close(fileId);
return 2;
}
_read(fileId, pData, (unsigned)dwPngSize);
_close(fileId);
TCHAR drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
_tsplitpath(szFileName, drive, dir, fname, ext);
MSN_SetMyAvatar(fname, pData, dwPngSize);
StoreAvatarData* par = (StoreAvatarData*)mir_alloc(sizeof(StoreAvatarData));
par->szName = mir_tstrdup(fname);
par->data = pData;
par->dataSize = dwPngSize;
par->szMimeType = "image/png";
ForkThread(&CMsnProto::msn_storeAvatarThread, par);
}
MSN_SetServerStatus(m_iStatus);
return 0;
}
示例10: MCONTACT
INT_PTR FacebookProto::OnCancelFriendshipRequest(WPARAM wParam, LPARAM)
{
if (wParam == NULL || isOffline())
return 1;
MCONTACT *hContact = new MCONTACT((MCONTACT)wParam);
ForkThread(&FacebookProto::CancelFriendsRequest, hContact);
return 0;
}
示例11: HANDLE
INT_PTR FacebookProto::ApproveFriendship(WPARAM wParam,LPARAM lParam)
{
if (wParam == NULL || isOffline())
return 1;
HANDLE *hContact = new HANDLE(reinterpret_cast<HANDLE>(wParam));
ForkThread(&FacebookProto::ApproveContactToServer, hContact);
return 0;
}
示例12: LOG
HANDLE __cdecl CYahooProto::SearchBasic( const TCHAR* nick )
{
LOG(("[YahooBasicSearch] Searching for: %S", nick));
if ( !m_bLoggedIn )
return 0;
ForkThread(&CYahooProto::search_simplethread, _tcsdup( nick ));
return ( HANDLE )1;
}
示例13: debugLogA
int CVkProto::SendMsg(MCONTACT hContact, int, const char *szMsg)
{
debugLogA("CVkProto::SendMsg");
if (!IsOnline())
return 0;
bool bIsChat = isChatRoom(hContact);
LONG iUserID = getDword(hContact, bIsChat ? "vk_chat_id" : "ID" , -1);
if (iUserID == -1 || iUserID == VK_FEED_USER) {
ForkThread(&CVkProto::SendMsgAck, new CVkSendMsgParam(hContact));
return 0;
}
int StickerId = 0;
ptrA pszRetMsg(GetStickerId(szMsg, StickerId));
ULONG uMsgId = ::InterlockedIncrement(&m_msgId);
AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, bIsChat? &CVkProto::OnSendChatMsg : &CVkProto::OnSendMessage, AsyncHttpRequest::rpHigh)
<< INT_PARAM(bIsChat ? "chat_id" : "user_id", iUserID)
<< INT_PARAM("guid", ((LONG) time(NULL)) * 100 + uMsgId % 100)
<< VER_API;
pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
if (StickerId)
pReq << INT_PARAM("sticker_id", StickerId);
else
pReq << CHAR_PARAM("message", szMsg);
if (!bIsChat)
pReq->pUserInfo = new CVkSendMsgParam(hContact, uMsgId);
Push(pReq);
if (!m_bServerDelivery && !bIsChat)
ForkThread(&CVkProto::SendMsgAck, new CVkSendMsgParam(hContact, uMsgId));
if (!IsEmpty(pszRetMsg)) {
Sleep(330);
SendMsg(hContact, 0, pszRetMsg);
}
return uMsgId;
}
示例14: SearchParam
HANDLE WhatsAppProto::SearchBasic(const TCHAR* id)
{
if (isOffline())
return 0;
// fake - we always accept search
SearchParam *param = new SearchParam(id, GetSerial());
ForkThread(&WhatsAppProto::SearchAckThread, param);
return (HANDLE)param->id;
}
示例15: debugLogA
INT_PTR __cdecl CYahooProto::SendNudge(WPARAM hContact, LPARAM lParam)
{
debugLogA("[YAHOO_SENDNUDGE]");
if (!m_bLoggedIn) {/* don't send nudge if we not connected! */
ForkThread(&CYahooProto::im_sendackfail, (void*)hContact);
return 1;
}
DBVARIANT dbv;
if (!getString(hContact, YAHOO_LOGINID, &dbv)) {
send_msg(dbv.pszVal, getWord(hContact, "yprotoid", 0), "<ding>", 0);
db_free(&dbv);
ForkThread(&CYahooProto::im_sendacksuccess, (void*)hContact);
return 1;
}
return 0;
}