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

  1. #include "stdafx.h"
  2. #include "datentry.h"
  3. #include "dateDlg.h"
  4. #ifndef _WIN32
  5. #include "ctl3d.h"
  6. #endif
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14.  
  15. BEGIN_MESSAGE_MAP(CDatentryApp, CWinApp)
  16.   //{{AFX_MSG_MAP(CDatentryApp)
  17.     // NOTE - the ClassWizard will add and remove mapping macros here.
  18.     //    DO NOT EDIT what you see in these blocks of generated code!
  19.   //}}AFX_MSG
  20.   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  21. END_MESSAGE_MAP()
  22.  
  23.  
  24. CDatentryApp::CDatentryApp()
  25. {
  26. }
  27.  
  28.  
  29. //the one and only app
  30. CDatentryApp theApp;
  31.  
  32.  
  33.  
  34. BOOL CDatentryApp::InitInstance()
  35. {
  36.   #ifdef _WIN32
  37.     Enable3dControls();
  38.   #else
  39.     Ctl3dRegister(AfxGetInstanceHandle());
  40.     Ctl3dAutoSubclass(AfxGetInstanceHandle());
  41.   #endif
  42.  
  43.   //initialise the DTime package
  44.   InitDTime();
  45.   BOOL bSuccess = InitDTimeSettings();
  46.     
  47.   //Uncomment the following line to try the german version of DTime
  48.   //SetThreadLocale(MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT));
  49.  
  50.   //bring up the dialog to demo DTime data entry
  51.   CDatentryDlg dlg;
  52.   m_pMainWnd = &dlg;
  53.   int nResponse = dlg.DoModal();
  54.   
  55.   return FALSE;
  56. }
  57.  
  58. int CDatentryApp::ExitInstance()
  59. {
  60.   #ifndef _WIN32
  61.     Ctl3dUnregister(AfxGetInstanceHandle());
  62.   #endif  
  63.           
  64.   //Close our use of the DTime package so 
  65.   //that statics in DTime classes do not appear
  66.   //as memory leaks
  67.   TermDTime();
  68.   
  69.   return CWinApp::ExitInstance();
  70. }
  71.  
  72.  
  73.