| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "pch/pch.h"
- #include "CLoginWnd.h"
- void CLoginFrameWnd::HandleLogin()
- {
- //判断账号密码是否正确
- std::wstring account, password;
- CEditUI* pAccountEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("accountedit")));
- if (pAccountEdit)
- {
- account = pAccountEdit->GetText().GetData();
- }
- CEditUI* pPasswordEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("pwdedit")));
- if (pPasswordEdit)
- {
- password = pPasswordEdit->GetText().GetData();
- }
- LOG_INFO("account:" << account.c_str() << ", password:" << password.c_str());
- rapidjson::Document doc;
- doc.SetObject();
- rapidjson::Document::AllocatorType &allocator = doc.GetAllocator(); //获取分配器
- string s_account = CLewaimaiString::wstring2string(account);
- doc.AddMember(rapidjson::StringRef("useranme"), rapidjson::StringRef(s_account.c_str()), allocator);
- string s_password = CLewaimaiString::wstring2string(password);
- doc.AddMember(rapidjson::StringRef("password"), rapidjson::StringRef(s_password.c_str()), allocator);
- rapidjson::StringBuffer buffer;
- rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
- doc.Accept(writer);
- std::string json = std::string(buffer.GetString());
- LOG_INFO("json:" << json.c_str());
- CGameFrameWnd* pFrame = new CGameFrameWnd();
- if (pFrame == NULL)
- {
- return;
- }
- pFrame->SetIcon(IDI_ICON_DUILIB);
- pFrame->Create(NULL, _T("游戏中心"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 738);
- pFrame->CenterWindow();
- ::ShowWindow(*pFrame, SW_SHOWMAXIMIZED);
- Close();
- }
|