home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dtime / data.1 / Dtset.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-08  |  2.1 KB  |  89 lines

  1. // dtset.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "resource.h"
  6. #include "dtset.h"
  7. #include "dtsetDlg.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CDTSetApp
  17.  
  18. BEGIN_MESSAGE_MAP(CDTSetApp, CWinApp)
  19.     //{{AFX_MSG_MAP(CDTSetApp)
  20.         // NOTE - the ClassWizard will add and remove mapping macros here.
  21.         //    DO NOT EDIT what you see in these blocks of generated code!
  22.     //}}AFX_MSG
  23.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  24. END_MESSAGE_MAP()
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CDTSetApp construction
  28.  
  29. CDTSetApp::CDTSetApp()
  30. {
  31. }
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // The one and only CDTSetApp object
  35.  
  36. CDTSetApp theApp;
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CDTSetApp initialization
  40.  
  41. BOOL CDTSetApp::InitInstance()
  42. {
  43.     Enable3dControls();
  44.  
  45.   //use the main help file for the dtime package
  46.   m_sHelpFilePath = m_pszHelpFilePath;
  47.   int nIndex = m_sHelpFilePath.ReverseFind('\\');
  48.   m_sHelpFilePath = m_sHelpFilePath.Left(nIndex+1) + CString("DTIME.HLP");
  49.   m_pszHelpFilePath = m_sHelpFilePath;
  50.  
  51.   //Initialise the DTime package
  52.   InitDTime();
  53.  
  54.   //create the settings dialog
  55.     CDTSetDlg dlg;
  56.     m_pMainWnd = &dlg;
  57.  
  58.   //load the settings from the registry
  59.   dlg.LoadSettings();
  60.  
  61.   //bring up the dialog
  62.     int nResponse = dlg.DoModal();
  63.     if (nResponse == IDOK)
  64.     {
  65.         //update the settings in the registry
  66.     dlg.SaveSettings();
  67.     }
  68.     
  69.   // Since the dialog has been closed, return FALSE so that we exit the
  70.     //  application, rather than start the application's message pump.
  71.     return FALSE;
  72. }
  73.  
  74. void CDTSetApp::WinHelp(DWORD /*dwData*/, UINT /*nCmd*/) 
  75. {
  76.   //always bring up the contents page
  77.     CWinApp::WinHelp(0, HELP_CONTENTS);
  78. }
  79.  
  80.  
  81.  
  82. int CDTSetApp::ExitInstance() 
  83. {
  84.     //finished with the DTime package
  85.   TermDTime();
  86.     
  87.     return CWinApp::ExitInstance();
  88. }
  89.