home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / com / commap / ctlcomm / ctlcomm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-03  |  2.1 KB  |  73 lines

  1. // ctlcomm.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "ctlcomm.h"
  6. #include "ctlcommDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCtlcommApp
  16.  
  17. BEGIN_MESSAGE_MAP(CCtlcommApp, CWinApp)
  18.     //{{AFX_MSG_MAP(CCtlcommApp)
  19.         // NOTE - the ClassWizard will add and remove mapping macros here.
  20.         //    DO NOT EDIT what you see in these blocks of generated code!
  21.     //}}AFX_MSG
  22.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCtlcommApp construction
  27.  
  28. CCtlcommApp::CCtlcommApp()
  29. {
  30.     // TODO: add construction code here,
  31.     // Place all significant initialization in InitInstance
  32. }
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // The one and only CCtlcommApp object
  36.  
  37. CCtlcommApp theApp;
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CCtlcommApp initialization
  41.  
  42. BOOL CCtlcommApp::InitInstance()
  43. {
  44.     // Standard initialization
  45.     // If you are not using these features and wish to reduce the size
  46.     //  of your final executable, you should remove from the following
  47.     //  the specific initialization routines you do not need.
  48.  
  49. #ifdef _AFXDLL
  50.     Enable3dControls();         // Call this when using MFC in a shared DLL
  51. #else
  52.     Enable3dControlsStatic();   // Call this when linking to MFC statically
  53. #endif
  54.  
  55.     CCtlcommDlg dlg;
  56.     m_pMainWnd = &dlg;
  57.     int nResponse = dlg.DoModal();
  58.     if (nResponse == IDOK)
  59.     {
  60.         // TODO: Place code here to handle when the dialog is
  61.         //  dismissed with OK
  62.     }
  63.     else if (nResponse == IDCANCEL)
  64.     {
  65.         // TODO: Place code here to handle when the dialog is
  66.         //  dismissed with Cancel
  67.     }
  68.  
  69.     // Since the dialog has been closed, return FALSE so that we exit the
  70.     //  application, rather than start the application's message pump.
  71.     return FALSE;
  72. }
  73.