http_overload.hpp 4.2 KB
Newer Older
L
ljc545w 已提交
1 2 3 4 5 6
#pragma once
#include "pch.h"

#ifdef USE_SOCKET
#define WS2LW(wstr) (LPWSTR) wstr.c_str()

L
ljc545w 已提交
7
BOOL __stdcall SendText(wstring wxid, wstring msg)
L
ljc545w 已提交
8 9 10 11
{
    return SendText(WS2LW(wxid), WS2LW(msg));
}

L
ljc545w 已提交
12
BOOL __stdcall SendAtText(wstring wsChatRoomId, vector<wstring> wxids, wstring wsTextMsg, BOOL AutoNickName)
L
ljc545w 已提交
13 14
{
    vector<DWORD> wxid_list;
L
ljc545w 已提交
15 16
    for (unsigned int i = 0; i < wxids.size(); i++)
        wxid_list.push_back((DWORD)wxids[i].c_str());
L
ljc545w 已提交
17 18 19 20 21 22 23 24
    return SendAtText(WS2LW(wsChatRoomId), wxid_list.data(), WS2LW(wsTextMsg), wxid_list.size(), AutoNickName);
}

BOOL __stdcall SendCard(wstring receiver, wstring sharedwxid, wstring nickname)
{
    return SendCard(WS2LW(receiver), WS2LW(sharedwxid), WS2LW(nickname));
}

L
ljc545w 已提交
25
BOOL __stdcall SendImage(wstring receiver, wstring ImagePath)
L
ljc545w 已提交
26 27 28 29
{
    return SendImage(WS2LW(receiver), WS2LW(ImagePath));
}

L
ljc545w 已提交
30
BOOL __stdcall SendFile(wstring receiver, wstring FilePath)
L
ljc545w 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
{
    return SendFile(WS2LW(receiver), WS2LW(FilePath));
}

BOOL __stdcall SendArticle(wstring wxid, wstring title, wstring abstract, wstring url, wstring imgpath)
{
    return SendArticle(WS2LW(wxid), WS2LW(title), WS2LW(abstract), WS2LW(url), WS2LW(imgpath));
}

BOOL __stdcall SendAppMsg(wstring wxid, wstring appid)
{
    return SendAppMsg(WS2LW(wxid), WS2LW(appid));
}

BOOL __stdcall DeleteUser(wstring wxid)
{
    return DeleteUser(WS2LW(wxid));
}

wstring __stdcall GetUserInfoByWxId(wstring wxid)
{
    return GetUserInfoByWxId(WS2LW(wxid));
}

wstring __stdcall GetUserNickNameByWxId(wstring wxid)
{
    return GetUserNickNameByWxId(WS2LW(wxid));
}

BOOL __stdcall AddFriendByV3(wstring v3, wstring message, int AddType)
{
    return AddFriendByV3(WS2LW(v3), WS2LW(message), AddType);
}

BOOL __stdcall AddFriendByWxid(wstring wxid, wstring message)
{
    return AddFriendByWxid(WS2LW(wxid), WS2LW(message));
}

BOOL __stdcall AddBrandContact(wstring PublicId)
{
    return AddBrandContact(WS2LW(PublicId));
}

BOOL __stdcall VerifyFriendApply(wstring v3_data, wstring v4_data)
{
    return VerifyFriendApply(WS2LW(v3_data), WS2LW(v4_data));
}

BOOL __stdcall EditRemark(wstring wxid, wstring remark)
{
    return EditRemark(WS2LW(wxid), WS2LW(remark));
}

wstring __stdcall GetChatRoomMemberNickname(wstring chatroomid, wstring wxid)
{
    return GetChatRoomMemberNickname(WS2LW(chatroomid), WS2LW(wxid));
}

BOOL __stdcall DelChatRoomMember(wstring chatroomid, vector<wstring> wxids)
{
    vector<wchar_t *> wxid_list;
L
ljc545w 已提交
93 94
    for (unsigned int i = 0; i < wxids.size(); i++)
        wxid_list.push_back(WS2LW(wxids[i]));
L
ljc545w 已提交
95 96 97 98 99 100
    return DelChatRoomMember(WS2LW(chatroomid), wxid_list.data(), wxid_list.size());
}

BOOL __stdcall AddChatRoomMember(wstring chatroomid, vector<wstring> wxids)
{
    vector<wchar_t *> wxid_list;
L
ljc545w 已提交
101 102
    for (unsigned int i = 0; i < wxids.size(); i++)
        wxid_list.push_back(WS2LW(wxids[i]));
L
ljc545w 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
    return AddChatRoomMember(WS2LW(chatroomid), wxid_list.data(), wxid_list.size());
}

BOOL __stdcall SetChatRoomAnnouncement(wstring chatroomid, wstring announcement)
{
    return SetChatRoomAnnouncement(WS2LW(chatroomid), WS2LW(announcement));
}

BOOL __stdcall SetChatRoomName(wstring chatroomid, wstring chatroomname)
{
    return SetChatRoomName(WS2LW(chatroomid), WS2LW(chatroomname));
}

BOOL __stdcall SetChatRoomSelfNickname(wstring chatroomid, wstring nickname)
{
    return SetChatRoomSelfNickname(WS2LW(chatroomid), WS2LW(nickname));
}

BOOL __stdcall ChangeWeChatVersion(wstring verStr)
{
    return ChangeWeChatVer(WS2LW(verStr));
}

L
ljc545w 已提交
126
BOOL __stdcall BackupSQLiteDB(DWORD DbHandle, wstring BackupFile)
L
ljc545w 已提交
127 128
{
    string filepath = unicode_to_utf8(WS2LW(BackupFile));
L
ljc545w 已提交
129
    return BackupSQLiteDB(DbHandle, filepath.c_str()) == SQLITE_OK;
L
ljc545w 已提交
130
}
L
ljc545w 已提交
131 132 133 134 135

BOOL __stdcall OpenBrowser(wstring url)
{
    return OpenBrowser(WS2LW(url));
}
136

137
BOOL __stdcall ForwardMessage(wstring wxid, ULONG64 msgid)
138
{
139
    return ForwardMessage(WS2LW(wxid), msgid);
140
}
L
ljc545w 已提交
141 142 143 144 145

BOOL __stdcall SendXmlMsg(wstring wxid, wstring xml, wstring imgpath)
{
    return SendXmlMsg(WS2LW(wxid), WS2LW(xml), WS2LW(imgpath));
}
L
ljc545w 已提交
146 147 148 149 150

BOOL __stdcall GetTransfer(wstring wxid, wstring transcationid, wstring transferid)
{
    return GetTransfer(WS2LW(wxid), WS2LW(transcationid), WS2LW(transferid));
}
L
ljc545w 已提交
151 152 153 154 155

BOOL __stdcall SendEmotion(wstring wxid, wstring img_path)
{
    return SendEmotion(WS2LW(wxid), WS2LW(img_path));
}
L
ljc545w 已提交
156
#endif