本文整理汇总了C++中ForkThread函数的典型用法代码示例。如果您正苦于以下问题:C++ ForkThread函数的具体用法?C++ ForkThread怎么用?C++ ForkThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ForkThread函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ForkThread
INT_PTR FacebookProto::RefreshBuddyList(WPARAM, LPARAM)
{
if (!isOffline()) {
facy.client_notify(TranslateT("Refreshing buddy list..."));
ForkThread(&FacebookProto::ProcessBuddyList, NULL);
}
return 0;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:8,代码来源:proto.cpp
示例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), "");
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:8,代码来源:contacts.cpp
示例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;
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:8,代码来源:messages.cpp
示例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;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:9,代码来源:proto.cpp
示例5: mir_tstrdup
HANDLE FacebookProto::SearchByEmail(const PROTOCHAR* email)
{
if (isOffline())
return 0;
TCHAR *temail = mir_tstrdup(email);
ForkThread(&FacebookProto::SearchAckThread, temail);
return temail;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:9,代码来源:proto.cpp
示例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;
}
开发者ID:sportarup,项目名称:miranda-dev,代码行数:9,代码来源:msn_proto.cpp
示例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;
}
开发者ID:sportarup,项目名称:miranda-dev,代码行数:9,代码来源:msn_proto.cpp
示例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;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:9,代码来源:proto.cpp
示例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;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:44,代码来源:msn_svcs.cpp
示例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;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:10,代码来源:proto.cpp
示例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;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:10,代码来源:proto.cpp
示例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;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:10,代码来源:search.cpp
示例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;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:43,代码来源:vk_messages.cpp
示例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;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:10,代码来源:proto.cpp
示例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;
}
开发者ID:martok,项目名称:miranda-ng,代码行数:20,代码来源:im.cpp
示例16: debugLogA
HANDLE CVkProto::SendFile(MCONTACT hContact, const TCHAR *desc, TCHAR **files)
{
debugLogA("CVkProto::SendFile");
LONG userID = getDword(hContact, "ID", -1);
if (!IsOnline() || ((userID == -1 || userID == VK_FEED_USER) && !isChatRoom(hContact)))
return (HANDLE)0;
CVkFileUploadParam *fup = new CVkFileUploadParam(hContact, desc, files);
ForkThread(&CVkProto::SendFileThread, (void *)fup);
return (HANDLE)fup;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:12,代码来源:vk_files.cpp
示例17: regex
HWND CToxProto::OnSearchAdvanced(HWND owner)
{
if (!IsOnline())
{
// we cannot add someone to friend list while tox is offline
return NULL;
}
std::smatch match;
std::regex regex("^\\s*([A-Fa-f0-9]{76})\\s*$");
TCHAR text[MAX_PATH];
GetDlgItemText(owner, IDC_SEARCH, text, _countof(text));
const std::string query = T2Utf(text).str();
if (std::regex_search(query, match, regex))
{
std::string address = match[1];
PROTOSEARCHRESULT psr = { sizeof(psr) };
psr.id.a = mir_strdup(query.c_str());
ADDCONTACTSTRUCT acs = { HANDLE_SEARCHRESULT };
acs.szProto = m_szModuleName;
acs.psr = &psr;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)owner, (LPARAM)&acs);
ForkThread(&CToxProto::SearchFailedAsync, NULL);
}
else
{
regex = "^\\s*(([^ @/:;()\"']+)(@[A-Za-z]+.[A-Za-z]{2,6})?)\\s*$";
if (std::regex_search(query, match, regex))
ForkThread(&CToxProto::SearchByNameAsync, mir_strdup(query.c_str()));
else
ForkThread(&CToxProto::SearchFailedAsync, NULL);
}
return (HWND)1;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:40,代码来源:tox_search.cpp
示例18: chatnav_param
INT_PTR CAimProto::OnJoinChat(WPARAM hContact, LPARAM)
{
if (m_state != 1)
return 0;
DBVARIANT dbv;
if (!getString(hContact, "ChatRoomID", &dbv)) {
chatnav_param* par = new chatnav_param(dbv.pszVal, getWord(hContact, "Exchange", 4));
ForkThread(&CAimProto::chatnav_request_thread, par);
db_free(&dbv);
}
return 0;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:13,代码来源:services.cpp
示例19: return
HANDLE GGPROTO::SearchBasic(const PROTOCHAR *id)
{
if (!isonline())
return (HANDLE)0;
gg_pubdir50_t req;
if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH))) {
#ifdef DEBUGMODE
debugLogA("SearchBasic(): ForkThread 10 GGPROTO::searchthread");
#endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HANDLE)1;
}
char *id_utf8 = mir_utf8encodeT(id);
// Add uin and search it
gg_pubdir50_add(req, GG_PUBDIR50_UIN, id_utf8);
gg_pubdir50_seq_set(req, GG_SEQ_SEARCH);
mir_free(id_utf8);
gg_EnterCriticalSection(&sess_mutex, "SearchBasic", 50, "sess_mutex", 1);
if (!gg_pubdir50(sess, req))
{
gg_LeaveCriticalSection(&sess_mutex, "SearchBasic", 50, 1, "sess_mutex", 1);
#ifdef DEBUGMODE
debugLogA("SearchBasic(): ForkThread 11 GGPROTO::searchthread");
#endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HANDLE)1;
}
gg_LeaveCriticalSection(&sess_mutex, "SearchBasic", 50, 2, "sess_mutex", 1);
debugLogA("SearchBasic(): Seq %d.", req->seq);
gg_pubdir50_free(req);
return (HANDLE)1;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:38,代码来源:gg_proto.cpp
示例20: MCONTACT
INT_PTR FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam)
{
if (wParam == NULL || isOffline())
return 1;
MCONTACT hContact = MCONTACT(wParam);
ptrA id(getStringA(hContact, FACEBOOK_KEY_ID));
if (id == NULL)
return 1;
ForkThread(&FacebookProto::AddContactToServer, new std::string(id));
return 0;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:14,代码来源:proto.cpp
注:本文中的ForkThread函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论