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