// next default values for new objects // #ifdef apstudio_invoked #ifndef apstudio_readonly_symbols #define _aps_next_resource_value 129 #define _aps_next_command_value 32771 #define _aps_next_control_value 1009 #define _aps_next_symed_value 101 #endif #endif <stdafx.cpp> // stdafx.cpp : source file that includes just the standard includes // mclient.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" < mclient.cpp> // mclient.cpp : defines the class behaviors for the application. //
begin_message_map(cmclientapp, cwinapp) //{{afx_msg_map(cmclientapp) // note - the classwizard will add and remove mapping macros here. // do not edit what you see in these blocks of generated code! //}}afx_msg on_command(id_help, cwinapp::onhelp) end_message_map()
///////////////////////////////////////////////////////////////////////////// // cmclientapp construction
cmclientapp::cmclientapp() { // todo: add construction code here, // place all significant initialization in initinstance }
///////////////////////////////////////////////////////////////////////////// // the one and only cmclientapp object
bool cmclientapp::initinstance() { if (failed(::coinitialize(null))) { return false; }
afxenablecontrolcontainer();
// standard initialization // if you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need.
#ifdef _afxdll enable3dcontrols(); // call this when using mfc in a shared dll #else enable3dcontrolsstatic(); // call this when linking to mfc statically #endif
cmclientdlg dlg; m_pmainwnd = &dlg; int nresponse = dlg.domodal(); if (nresponse == idok) { // todo: place code here to handle when the dialog is // dismissed with ok } else if (nresponse == idcancel) { // todo: place code here to handle when the dialog is // dismissed with cancel }
::couninitialize();
// since the dialog has been closed, return false so that we exit the // application, rather than start the application's message pump. return false; }