00001
00002
00003
00004 #include "stdafx.h"
00005 #include "resource.h"
00006 #include "aboutdlg.h"
00007 #include "MainDlg.h"
00008
00009 CAppModule _Module;
00010
00011 int Run(LPTSTR = NULL, int nCmdShow = SW_SHOWDEFAULT)
00012 {
00013 CMessageLoop theLoop;
00014 _Module.AddMessageLoop(&theLoop);
00015
00016 CMainDlg dlgMain;
00017
00018 if(dlgMain.Create(NULL) == NULL)
00019 {
00020 ATLTRACE(_T("Main dialog creation failed!\n"));
00021 return 0;
00022 }
00023
00024 dlgMain.ShowWindow(nCmdShow);
00025
00026 int nRet = theLoop.Run();
00027
00028 _Module.RemoveMessageLoop();
00029 return nRet;
00030 }
00031
00032 int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE , LPTSTR lpstrCmdLine, int nCmdShow)
00033 {
00034 HRESULT hRes = ::CoInitialize(NULL);
00035
00036
00037
00038 ATLASSERT(SUCCEEDED(hRes));
00039
00040
00041 ::DefWindowProc(NULL, 0, 0, 0L);
00042
00043 AtlInitCommonControls(ICC_BAR_CLASSES);
00044
00045 hRes = _Module.Init(NULL, hInstance);
00046 ATLASSERT(SUCCEEDED(hRes));
00047
00048 int nRet = Run(lpstrCmdLine, nCmdShow);
00049
00050 _Module.Term();
00051 ::CoUninitialize();
00052
00053 return nRet;
00054 }