1 // gdipp_demo.cpp : main source file for gdipp_demo.exe
5 #include "gdipp_demo/resource.h"
6 #include "gdipp_demo/MainDlg.h"
10 int Run(LPTSTR
/*lpstrCmdLine*/ = NULL
, int nCmdShow
= SW_SHOWDEFAULT
)
13 _Module
.AddMessageLoop(&theLoop
);
17 if(dlgMain
.Create(NULL
) == NULL
)
19 ATLTRACE(_T("Main dialog creation failed!\n"));
23 dlgMain
.ShowWindow(nCmdShow
);
25 int nRet
= theLoop
.Run();
27 _Module
.RemoveMessageLoop();
31 int WINAPI
_tWinMain(HINSTANCE hInstance
, HINSTANCE
/*hPrevInstance*/, LPTSTR lpstrCmdLine
, int nCmdShow
)
33 // If you are running on NT 4.0 or higher you can use the following call instead to
34 // make the EXE free threaded. This means that calls come in on a random RPC thread.
35 HRESULT hRes
= ::CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
36 ATLASSERT(SUCCEEDED(hRes
));
38 // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
39 ::DefWindowProc(NULL
, 0, 0, 0L);
41 AtlInitCommonControls(ICC_BAR_CLASSES
); // add flags to support other controls
43 hRes
= _Module
.Init(NULL
, hInstance
);
44 ATLASSERT(SUCCEEDED(hRes
));
46 int nRet
= Run(lpstrCmdLine
, nCmdShow
);