Impl SendImageMsg

This commit is contained in:
Changhua
2021-08-22 21:57:16 +08:00
parent c4d0a521ab
commit ae8e20c4e7
14 changed files with 102 additions and 15 deletions
+18
View File
@@ -225,6 +225,24 @@ int WxSendTextMsg(wstring wxid, wstring at_wxid, wstring msg)
return innerWxSendTextMsg(wxid.c_str(), at_wxid.c_str(), msg.c_str());
}
static int innerWxSendImageMsg(const wchar_t *wxid, const wchar_t *path)
{
int ret = 0;
unsigned long ulCode = 0;
RpcTryExcept { ret = client_SendImageMsg(wxid, path); }
RpcExcept(1)
{
ulCode = RpcExceptionCode();
printf("Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode);
}
RpcEndExcept
return ret;
}
int WxSendImageMsg(wstring wxid, wstring path) { return innerWxSendImageMsg(wxid.c_str(), path.c_str()); }
static int getAddrHandle(DWORD *addr, HANDLE *handle)
{
DWORD processID = 0;
+1
View File
@@ -3,3 +3,4 @@ EXPORTS
WxSetTextMsgCb
WxSendTextMsg
WxGetMsgTypes
WxSendImageMsg
+1
View File
@@ -22,4 +22,5 @@ typedef map<int, wstring> MsgTypesMap_t;
int WxInitSDK();
int WxSetTextMsgCb(const std::function<int(WxMessage_t)> &onMsg);
int WxSendTextMsg(wstring wxid, wstring at_wxid, wstring msg);
int WxSendImageMsg(wstring wxid, wstring path);
MsgTypesMap_t WxGetMsgTypes();