Impl get db names with sql

This commit is contained in:
Changhua
2022-08-07 23:32:25 +08:00
parent 99b42a2bb1
commit 1f5eae96de
16 changed files with 199 additions and 47 deletions
+16 -3
View File
@@ -20,6 +20,14 @@ void printContacts(ContactMap_t contacts)
}
}
void printDbNames(vector<wstring> vDbs)
{
wprintf(L"db numbers: %ld\n", vDbs.size());
for (auto it = vDbs.begin(); it != vDbs.end(); ++it) {
wprintf(L"%s\n", (*it).c_str());
}
}
int onTextMsg(WxMessage_t msg)
{
wprintf(L"%s msgType: %d, msgSource: %d, isSelf: %d\n", msg.id.c_str(), msg.type, msg.source, msg.self);
@@ -45,14 +53,14 @@ int main()
wprintf(L"%d\n", status);
if (status != 0) {
return 0;
}
}
// 获取消息类型
// 获取消息类型
wprintf(L"获取消息类型\n");
const MsgTypesMap_t WxMsgTypes = WxGetMsgTypes();
for (auto it = WxMsgTypes.begin(); it != WxMsgTypes.end(); ++it) {
wprintf(L"%d: %s\n", it->first, it->second.c_str());
}
}
wprintf(L"Message: 接收通知中......\n");
WxSetTextMsgCb(onTextMsg);
@@ -71,6 +79,11 @@ int main()
// 测试获取联系人
auto mContact = WxGetContacts();
printContacts(mContact);
Sleep(1000); // 等待1秒
// 测试获取数据库名
auto vDbNames = WxGetDbNames();
printDbNames(vDbNames);
while (1) {
Sleep(10000); // 休眠,释放CPU