| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include "pch/pch.h"
- #include "wnd/CLoginWnd.h"
- #include "network/CMessagePush.h"
- #include <sqlite3/sqlite3.h>
- int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
- _In_opt_ HINSTANCE hPrevInstance,
- _In_ LPWSTR lpCmdLine,
- _In_ int nCmdShow)
- {
- //初始化日志
- CLewaimaiLog log;
- log.Init();
- //读取配置文件
- CConfigReader::ReadConfigFile();
- //读取sqlite里面的设置信息
- sqlite3 *db;
- int rc;
- rc = sqlite3_open("db/pos.db", &db);
- if(rc)
- {
- LOG_INFO("Can't open database: " << sqlite3_errmsg(db));
- return -1;
- }
- else
- {
- LOG_INFO("Opened database successfully");
- }
- sqlite3_close(db);
- //由这个对象来处理消息推送
- boost::asio::io_context io_context;
- CMessagePush push(io_context);
- push.Start();
- //开始展示窗口
- CPaintManagerUI::SetInstance(hInstance);
- #if 0
- CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
- CPaintManagerUI::SetResourceZip(_T("skin.zip"));
- #else
- CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
- #endif
- HRESULT Hr = ::CoInitialize(NULL);
- if(FAILED(Hr))
- {
- return 0;
- }
- CMainWnd* pFrame = new CMainWnd();
- if(pFrame == NULL)
- {
- return 0;
- }
- pFrame->SetIcon(IDI_ICON_DUILIB);
- pFrame->Create(NULL, _T("游戏中心"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 738);
- pFrame->CenterWindow();
- ::ShowWindow(*pFrame, SW_SHOWMAXIMIZED);
- /*
- CLoginFrameWnd* pLoginFrame = new CLoginFrameWnd();
- if (pLoginFrame == NULL) { return 0; }
- pLoginFrame->Create(NULL, _T(""), UI_WNDSTYLE_DIALOG, 0, 0, 0, 0, 0, NULL);
- pLoginFrame->SetIcon(IDI_ICON_DUILIB);
- pLoginFrame->CenterWindow();
- pLoginFrame->ShowModal();*/
- CPaintManagerUI::MessageLoop();
- ::CoUninitialize();
- return 0;
- }
|