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

  1. // dbfetch.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 "dbfetch.h"
  15. #include "fetchDlg.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. // CDbfetchApp
  25.  
  26. BEGIN_MESSAGE_MAP(CDbfetchApp, CWinApp)
  27.     //{{AFX_MSG_MAP(CDbfetchApp)
  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. // CDbfetchApp construction
  36.  
  37. CDbfetchApp::CDbfetchApp()
  38. {
  39.     // TODO: add construction code here,
  40.     // Place all significant initialization in InitInstance
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // The one and only CDbfetchApp object
  45.  
  46. CDbfetchApp theApp;
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CDbfetchApp initialization
  50.  
  51. BOOL CDbfetchApp::InitInstance()
  52. {
  53.     // Standard initialization
  54.     // If you are not using these features and wish to reduce the size
  55.     // of your final executable, you should remove from the following
  56.     // the specific initialization routines you do not need.
  57.  
  58. #ifdef _AFXDLL
  59.     Enable3dControls();         // Call this when using MFC in a shared DLL
  60. #else
  61.     Enable3dControlsStatic();   // Call this when linking to MFC statically
  62. #endif
  63.  
  64.     CDbfetchDlg dlg;
  65.     m_pMainWnd = &dlg;
  66.     int nResponse = dlg.DoModal();
  67.     if (nResponse == IDOK)
  68.     {
  69.         // TODO: Place code here to handle when the dialog is
  70.         // dismissed with OK
  71.     }
  72.     else if (nResponse == IDCANCEL)
  73.     {
  74.         // TODO: Place code here to handle when the dialog is
  75.         // dismissed with Cancel
  76.     }
  77.  
  78.     // Since the dialog has been closed, return FALSE so that we exit the
  79.     // application, rather than start the application's message pump.
  80.     return FALSE;
  81. }
  82.