SProxy.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // dui-demo.cpp : main source file
  2. //
  3. #include "stdafx.h"
  4. #include "MainDlg.h"
  5. #include "LoginDlg.h"
  6. #include "SouiInit.h"
  7. #include "CApp.h"
  8. int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int /*nCmdShow*/)
  9. {
  10. HRESULT hRes = OleInitialize(NULL);
  11. SASSERT(SUCCEEDED(hRes));
  12. int nRet = 0;
  13. new CApp();
  14. CApp::getSingletonPtr()->Init();
  15. CSouiLoader Loader(hInstance);
  16. InitSystemRes(Loader.GetApp(), Loader.GetComMgr());
  17. InitUserRes(Loader.GetApp(), Loader.GetComMgr());
  18. new SNotifyCenter();
  19. nRet = Run<CLoginDlg>(Loader.GetApp());
  20. if (CApp::getSingletonPtr()->GetOut() == 1)
  21. {
  22. nRet = Run<CMainDlg>(Loader.GetApp());
  23. }
  24. delete CApp::getSingletonPtr();
  25. delete SNotifyCenter::getSingletonPtr();
  26. OleUninitialize();
  27. return nRet;
  28. }