Fix At member for text message sending
This commit is contained in:
+3
-3
@@ -66,7 +66,7 @@ int RpcDisableReceiveMsg()
|
||||
// UnHook Message receiving
|
||||
client_DisableReceiveMsg();
|
||||
}
|
||||
RpcExcept(1)
|
||||
RpcExcept(1)
|
||||
{
|
||||
ulCode = RpcExceptionCode();
|
||||
printf("RpcDisableReceiveMsg exception 0x%lx = %ld\n", ulCode, ulCode);
|
||||
@@ -96,12 +96,12 @@ int RpcIsLogin()
|
||||
return loginFlag;
|
||||
}
|
||||
|
||||
int RpcSendTextMsg(const wchar_t *wxid, const wchar_t *at_wxid, const wchar_t *msg)
|
||||
int RpcSendTextMsg(const wchar_t *wxid, const wchar_t *msg, const wchar_t *atWxids)
|
||||
{
|
||||
int ret = 0;
|
||||
unsigned long ulCode = 0;
|
||||
|
||||
RpcTryExcept { ret = client_SendTextMsg(wxid, at_wxid, msg); }
|
||||
RpcTryExcept { ret = client_SendTextMsg(wxid, msg, atWxids); }
|
||||
RpcExcept(1)
|
||||
{
|
||||
ulCode = RpcExceptionCode();
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ RPC_STATUS RpcDisconnectServer();
|
||||
int RpcEnableReceiveMsg();
|
||||
int RpcDisableReceiveMsg();
|
||||
int RpcIsLogin();
|
||||
int RpcSendTextMsg(const wchar_t *wxid, const wchar_t *at_wxid, const wchar_t *msg);
|
||||
int RpcSendTextMsg(const wchar_t *wxid, const wchar_t *msg, const wchar_t *atWxids);
|
||||
int RpcSendImageMsg(const wchar_t *wxid, const wchar_t *path);
|
||||
PPRpcIntBstrPair RpcGetMsgTypes(int *pNum);
|
||||
PPRpcContact RpcGetContacts(int *pNum);
|
||||
|
||||
+6
-6
@@ -51,8 +51,7 @@ int WxInitSDK()
|
||||
status = RpcIsLogin();
|
||||
if (status == -1) {
|
||||
return status;
|
||||
}
|
||||
else if (status == 1) {
|
||||
} else if (status == 1) {
|
||||
break;
|
||||
}
|
||||
Sleep(1000);
|
||||
@@ -66,8 +65,8 @@ int WxDestroySDK()
|
||||
WxDisableRecvMsg();
|
||||
RpcDisconnectServer();
|
||||
// 关闭 RPC,但不卸载 DLL,方便下次使用。
|
||||
//EjectDll(WeChatPID, SpyDllPath);
|
||||
|
||||
// EjectDll(WeChatPID, SpyDllPath);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -76,6 +75,7 @@ int WxEnableRecvMsg(const std::function<int(WxMessage_t)> &onMsg)
|
||||
if (onMsg) {
|
||||
HANDLE msgThread;
|
||||
g_cbReceiveTextMsg = onMsg;
|
||||
|
||||
msgThread = (HANDLE)CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)RpcEnableReceiveMsg, NULL, 0, NULL);
|
||||
if (msgThread == NULL) {
|
||||
printf("Failed to create innerWxRecvTextMsg.\n");
|
||||
@@ -96,9 +96,9 @@ int WxDisableRecvMsg()
|
||||
return -1;
|
||||
}
|
||||
|
||||
int WxSendTextMsg(wstring wxid, wstring at_wxid, wstring msg)
|
||||
int WxSendTextMsg(wstring wxid, wstring msg, wstring atWxids)
|
||||
{
|
||||
return RpcSendTextMsg(wxid.c_str(), at_wxid.c_str(), msg.c_str());
|
||||
return RpcSendTextMsg(wxid.c_str(), msg.c_str(), atWxids.c_str());
|
||||
}
|
||||
|
||||
int WxSendImageMsg(wstring wxid, wstring path) { return RpcSendImageMsg(wxid.c_str(), path.c_str()); }
|
||||
|
||||
@@ -37,11 +37,11 @@ typedef map<int, wstring> MsgTypesMap_t;
|
||||
typedef map<wstring, WxContact_t> ContactMap_t;
|
||||
typedef vector<WxDbTable_t> DbTableVector_t;
|
||||
|
||||
int WxInitSDK();
|
||||
int WxInitSDK();
|
||||
int WxDestroySDK();
|
||||
int WxEnableRecvMsg(const std::function<int(WxMessage_t)> &onMsg);
|
||||
int WxDisableRecvMsg();
|
||||
int WxSendTextMsg(wstring wxid, wstring at_wxid, wstring msg);
|
||||
int WxSendTextMsg(wstring wxid, wstring msg, wstring vAtWxids);
|
||||
int WxSendImageMsg(wstring wxid, wstring path);
|
||||
ContactMap_t WxGetContacts();
|
||||
MsgTypesMap_t WxGetMsgTypes();
|
||||
|
||||
Reference in New Issue
Block a user