home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / ado / read / adoread.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-02  |  2.2 KB  |  82 lines

  1. //--------------------------------------------------------------------
  2. // Microsoft ADO Samples
  3. //
  4. // (c) 1996 Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // @doc ADORead Sample
  7. //
  8. // @module    ADOread.cpp
  9. //
  10. // @devnote None
  11. //--------------------------------------------------------------------
  12. // ADORead.cpp : Defines the class behaviors for the application.
  13. //
  14.  
  15. #include "stdafx.h"
  16. #include "ADORead.h"
  17. #include "ADORdDlg.h"
  18.  
  19. #ifdef _DEBUG
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CADOReadApp
  26.  
  27. BEGIN_MESSAGE_MAP(CADOReadApp, CWinApp)
  28.     //{{AFX_MSG_MAP(CADOReadApp)
  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. // CADOReadApp construction
  37.  
  38. CADOReadApp::CADOReadApp()
  39. {
  40.     // TODO: add construction code here,
  41.     // Place all significant initialization in InitInstance
  42. }
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // The one and only CADOReadApp object
  46.  
  47. CADOReadApp theApp;
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CADOReadApp initialization
  51.  
  52. BOOL CADOReadApp::InitInstance()
  53. {
  54.     // Standard initialization
  55.     // If you are not using these features and wish to reduce the size
  56.     //  of your final executable, you should remove from the following
  57.     //  the specific initialization routines you do not need.
  58.  
  59.     //Enable3dControls();
  60.     AfxEnableWin40Compatibility();
  61.  
  62.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  63.  
  64.     CADOReadDlg 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.