// ATLFrame.cpp : Implementation of WinMain #include "stdafx.h" #include "resource.h" #include "ATLFrame.h" #include "Demo.h" //class CATLFrameModule : public CAtlExeModuleT< CATLFrameModule > //{ //public : // DECLARE_LIBID(LIBID_ATLFrameLib) // DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ATLFRAME, "{11DC3718-41BD-42CC-ADAB-A533C2EC05E7}") //}; CComModule _Module; BEGIN_OBJECT_MAP(ObjectMap) END_OBJECT_MAP() // extern "C" int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int nShowCmd) { lpCmdLine = GetCommandLine(); _Module.Init(ObjectMap, hInstance); CDemo demo; HICON hIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON1)); demo.GetWndClassInfo().m_wc.hIcon = hIcon; demo.Create(GetDesktopWindow(),CWindow::rcDefault,_T("ATLFrame"),0,0); demo.CenterWindow(); demo.ShowWindow(nShowCmd); MSG msg; while(GetMessage(&msg,0,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } _Module.Term(); return msg.wParam; }