home *** CD-ROM | disk | FTP | other *** search
- /***************************************************
- HTBMeter.dll
-
- HTBmeter.cpp
-
- Copyright TransEra Corporation 1999
- ***************************************************/
- #include "stdafx.h"
- #include "HTBmeter.h"
- #include "MeterDlg.h"
- #include "DialogThread.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
-
- BEGIN_MESSAGE_MAP(CHTBmeterApp, CWinApp)
- //{{AFX_MSG_MAP(CHTBmeterApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- CHTBmeterApp::CHTBmeterApp()
- {
- }
-
- CHTBmeterApp theApp;
-
- short g_Xpos;
- short g_Ypos;
- long * g_pBasicVar;
- MeterDlg * g_MeterVar;
-
-
- /////////////////////////////////////////////////////////////////////////////
- /*
- Function: Meter
-
- Description: Starts the meter
-
- Return type: void
- Argument: long* pBasicVar
- Argument: short xpos
- Argument: short ypos
-
- Notes: this function starts the meter dialog box and then
- sets up the window with the values coming in as parameters
- then information can go back and forth between the meter
- and HTBasic.
-
- */
- void Meter(long* pBasicVar, short xpos, short ypos)
- {
- g_Xpos = xpos;
- g_Ypos = ypos;
-
- if (g_MeterVar == NULL)
- {
- g_pBasicVar = pBasicVar;
-
- CWinThread * pThread = AfxBeginThread(RUNTIME_CLASS (DialogThread)); // create thread to execute dialog
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- /*
- Function: Closemeter
-
- Description: Closes the meter
-
- Return type: void
-
- Notes: Closes the meter by NICELY shutting down the app and the
- thread that it was running on.
-
- */
- void Closemeter()
- {
- if (g_MeterVar != NULL)
- {
- g_MeterVar->KillTimer(1); // stop timer from updating dialog
- g_MeterVar->EndDialog(1); // tell dialog to end
- g_MeterVar = NULL; // set pointer to NULL to show no dialog running (dialog is still shutting down)
-
- }
- }
-