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 / getrows / getrows.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-15  |  2.1 KB  |  76 lines

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