home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / database / daoctl / daocont.cpp < prev    next >
C/C++ Source or Header  |  1998-03-26  |  3KB  |  89 lines

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