zhipuzi_pos_windows.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. CMessagePush push;
  18. push.Start();
  19. //开始展示窗口
  20. CPaintManagerUI::SetInstance(hInstance);
  21. #if 0
  22. CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
  23. CPaintManagerUI::SetResourceZip(_T("skin.zip"));
  24. #else
  25. CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));
  26. #endif
  27. HRESULT Hr = ::CoInitialize(NULL);
  28. if(FAILED(Hr))
  29. {
  30. return 0;
  31. }
  32. //先显示登录窗口
  33. CLoginWnd* pLogin = new CLoginWnd();
  34. if(pLogin == NULL)
  35. {
  36. return 0;
  37. }
  38. pLogin->Create(NULL, _T("智铺子收银软件登录"), UI_WNDSTYLE_DIALOG, 0, 0, 0, 0, 0, NULL);
  39. pLogin->SetIcon(IDI_ICON_DUILIB);
  40. pLogin->CenterWindow();
  41. pLogin->ShowModal();
  42. CPaintManagerUI::MessageLoop();
  43. ::CoUninitialize();
  44. return 0;
  45. }