home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / DLL_Toolkit / Source / HTBMeter / DialogThread.cpp next >
Encoding:
C/C++ Source or Header  |  2005-03-02  |  1.7 KB  |  80 lines

  1. /***************************************************
  2. HTBMeter.dll
  3.  
  4. DialogThread.cpp
  5.  
  6. Copyright TransEra Corporation 1999 
  7. ***************************************************/
  8.  
  9. #include "stdafx.h"
  10. #include "HTBmeter.h"
  11. #include "DialogThread.h"
  12. #include "MeterDlg.h"
  13.  
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18.  
  19. #endif
  20.  
  21.  
  22. extern MeterDlg * g_MeterVar;                        // used to hold pointer to dialog box outside of new thread
  23.  
  24. IMPLEMENT_DYNCREATE(DialogThread, CWinThread)
  25.  
  26. DialogThread::DialogThread() 
  27. {    
  28. }
  29.  
  30. DialogThread::~DialogThread() 
  31. {
  32. }
  33. /////////////////////////////////////////////////////////////////////////////
  34. /*
  35.     Function:        DialogThread::InitInstance
  36.  
  37.     Description:    Intializations and start of Dialog
  38.  
  39.     Return type:    BOOL 
  40.  
  41.     Notes:            A modal is performed on the Meter class,
  42.                     this in turn starts the window on a seperate
  43.                     thread which is seen in DialogThread.cpp.
  44.         
  45. */
  46. BOOL DialogThread::InitInstance() 
  47. {        
  48.     MeterDlg Dlg;                                    // dialog box
  49.     g_MeterVar = &Dlg;                                    // save pointer to new dialog box for use outside this thread    
  50.     Dlg.DoModal();                                        // put in on the screen
  51.     return TRUE;
  52. }
  53.  
  54.  
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. /*
  58.     Function:        DialogThread::ExitInstance
  59.  
  60.     Description:    Closes Thread and app window
  61.  
  62.     Return type:    int 
  63.  
  64.     Notes:            returns the thread information so that the thread can be
  65.                     nicely shut.
  66.         
  67. */
  68. int DialogThread::ExitInstance() 
  69. {    
  70.     return CWinThread::ExitInstance();
  71. }
  72.  
  73. BEGIN_MESSAGE_MAP(DialogThread, CWinThread)
  74.     //{{AFX_MSG_MAP(DialogThread)
  75.         // NOTE - the ClassWizard will add and remove mapping macros here.
  76.     //}}AFX_MSG_MAP
  77. END_MESSAGE_MAP()
  78.  
  79.  
  80.