zhipuzi_pos_windows.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include "pch/pch.h"
  2. #include "wnd/CLoginWnd.h"
  3. #include "network/CMessagePush.h"
  4. int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
  5. _In_opt_ HINSTANCE hPrevInstance,
  6. _In_ LPWSTR lpCmdLine,
  7. _In_ int nCmdShow)
  8. {
  9. //初始化日志
  10. CLewaimaiLog log;
  11. log.Init();
  12. //读取配置文件
  13. CConfigReader::ReadConfigFile();
  14. //读取sqlite里面的设置信息
  15. CSqlite3 sqllite;
  16. sqllite.InitConfig();
  17. sqllite.Close();
  18. //由这个对象来处理消息推送
  19. boost::asio::io_context io_context;
  20. CMessagePush push(io_context);
  21. push.Start();
  22. //开始展示窗口
  23. CPaintManagerUI::SetInstance(hInstance);
  24. #if 0
  25. CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
  26. CPaintManagerUI::SetResourceZip(_T("skin.zip"));
  27. #else
  28. CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
  29. #endif
  30. HRESULT Hr = ::CoInitialize(NULL);
  31. if(FAILED(Hr))
  32. {
  33. return 0;
  34. }
  35. CMainWnd* pFrame = new CMainWnd();
  36. if(pFrame == NULL)
  37. {
  38. return 0;
  39. }
  40. pFrame->SetIcon(IDI_ICON_DUILIB);
  41. pFrame->Create(NULL, _T("游戏中心"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 738);
  42. pFrame->CenterWindow();
  43. ::ShowWindow(*pFrame, SW_SHOWMAXIMIZED);
  44. /*
  45. CLoginFrameWnd* pLoginFrame = new CLoginFrameWnd();
  46. if (pLoginFrame == NULL) { return 0; }
  47. pLoginFrame->Create(NULL, _T(""), UI_WNDSTYLE_DIALOG, 0, 0, 0, 0, 0, NULL);
  48. pLoginFrame->SetIcon(IDI_ICON_DUILIB);
  49. pLoginFrame->CenterWindow();
  50. pLoginFrame->ShowModal();*/
  51. CPaintManagerUI::MessageLoop();
  52. ::CoUninitialize();
  53. return 0;
  54. }