zhipuzi_pos_windows.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. //由这个对象来处理消息推送
  15. boost::asio::io_context io_context;
  16. CMessagePush push(io_context);
  17. push.Start();
  18. //开始展示窗口
  19. CPaintManagerUI::SetInstance(hInstance);
  20. #if 0
  21. CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
  22. CPaintManagerUI::SetResourceZip(_T("skin.zip"));
  23. #else
  24. CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
  25. #endif
  26. HRESULT Hr = ::CoInitialize(NULL);
  27. if(FAILED(Hr))
  28. {
  29. return 0;
  30. }
  31. CGameFrameWnd* pFrame = new CGameFrameWnd();
  32. if(pFrame == NULL)
  33. {
  34. return 0;
  35. }
  36. pFrame->SetIcon(IDI_ICON_DUILIB);
  37. pFrame->Create(NULL, _T("游戏中心"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 738);
  38. pFrame->CenterWindow();
  39. ::ShowWindow(*pFrame, SW_SHOWMAXIMIZED);
  40. /*
  41. CLoginFrameWnd* pLoginFrame = new CLoginFrameWnd();
  42. if (pLoginFrame == NULL) { return 0; }
  43. pLoginFrame->Create(NULL, _T(""), UI_WNDSTYLE_DIALOG, 0, 0, 0, 0, 0, NULL);
  44. pLoginFrame->SetIcon(IDI_ICON_DUILIB);
  45. pLoginFrame->CenterWindow();
  46. pLoginFrame->ShowModal();*/
  47. CPaintManagerUI::MessageLoop();
  48. ::CoUninitialize();
  49. return 0;
  50. }