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

  1. /*****************************************************
  2. HTBSwitch.dll
  3.  
  4.   DialogThread.cpp
  5.  
  6.   Copyright 1999 TransEra Corporation
  7.  
  8. *****************************************************/
  9. #include "stdafx.h"
  10. #include "HTBswitch.h"
  11. #include "DialogThread.h"
  12. #include "SwitchDlg.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. extern SwitchDlg * g_SwitchVar;                        // used to hold pointer to dialog box outside of new thread
  22.  
  23.  
  24.  
  25. IMPLEMENT_DYNCREATE(DialogThread, CWinThread)
  26.  
  27. DialogThread::DialogThread() 
  28. {    
  29. }
  30.  
  31. DialogThread::~DialogThread() 
  32. {
  33. }
  34.  
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. /*
  38.     Function:        DialogThread::InitInstance
  39.  
  40.     Description:    Initializes values and starts DLG    
  41.  
  42.     Return type:    BOOL 
  43.  
  44.     Notes:            Starts dialof Box window and does a modal
  45.                     on it for the duartion of its life.
  46.         
  47. */
  48. BOOL DialogThread::InitInstance() 
  49. {        
  50.     SwitchDlg Dlg;                                    // dialog box
  51.     g_SwitchVar = &Dlg;                                    // save pointer to new dialog box for use outside this thread    
  52.     Dlg.DoModal();                                        // put in on the screen
  53.     return TRUE;
  54. }
  55.  
  56.  
  57.  
  58. /////////////////////////////////////////////////////////////////////////////
  59. /*
  60.     Function:        DialogThread::ExitInstance
  61.  
  62.     Description:    Closes down Switch
  63.  
  64.     Return type:    int 
  65.  
  66.     Notes:            closes down switch and closes the trea it was running on.
  67.         
  68. */
  69. int DialogThread::ExitInstance() 
  70. {    
  71.     return CWinThread::ExitInstance();
  72. }
  73.  
  74. BEGIN_MESSAGE_MAP(DialogThread, CWinThread)
  75.     //{{AFX_MSG_MAP(DialogThread)
  76.         // NOTE - the ClassWizard will add and remove mapping macros here.
  77.     //}}AFX_MSG_MAP
  78. END_MESSAGE_MAP()
  79.  
  80.  
  81.