home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / controls / smiley / smiley.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.4 KB  |  85 lines

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