home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************
-
- HTBGraph.cpp
- Copyright TransEra Corporation 1999.
-
- ***********************************************************/
-
-
- #include "stdafx.h"
- #include "HTBgraph.h"
- #include "GraphDlg.h"
- #include "DialogThread.h"
-
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
-
- BEGIN_MESSAGE_MAP(CHTBgraphApp, CWinApp)
- //{{AFX_MSG_MAP(CHTBgraphApp)
- // 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()
-
- CHTBgraphApp::CHTBgraphApp()
- {
-
- }
-
- CHTBgraphApp theApp;
-
- short g_XPos;
- short g_YPos;
- long * pBasicVar0;
- long * pBasicVar1;
- long * pBasicVar2;
-
- GraphDlg * g_GraphVar;
-
- /////////////////////////////////////////////////////////////////////////////
- /*
- Function: Graph
-
- Description: Starts the graph DLL
-
- Return type: void
- Argument: long* pBasicIn0
- Argument: long* pBasicIn1
- Argument: long* pBasicIn2
- Argument: short * Xpos
- Argument: short * Ypos
-
- Notes: Brings information in from HTBasic and sends values [pointers]
- to appropriate variables. Sets values for initial dialog location
- and establishes communication paths through the DLL to HTBasic.
-
- */
- void Graph(long* pBasicIn0, long* pBasicIn1, long* pBasicIn2, short InXpos, short InYpos)
- {
- g_XPos = InXpos; // Assign start X position to Dialog box
- g_YPos = InYpos; // Assign start Y position to Dialog box
-
- if (g_GraphVar == NULL)
- {
- pBasicVar0 = pBasicIn0;
- pBasicVar1 = pBasicIn1;
- pBasicVar2 = pBasicIn2;
- CWinThread * pThread = AfxBeginThread(RUNTIME_CLASS (DialogThread)); // create thread to execute dialog
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- /*
- Function: Closegraph
-
- Description: Closes down the Thread and window
-
- Return type: void
-
- Notes: This function will cleanly shut down the worker thread and
- then bring all operations to a close within this memory space.
- */
- void Closegraph()
- {
- if (g_GraphVar != NULL)
- {
- g_GraphVar->KillTimer(1); // stop timer from updating dialog
- g_GraphVar->EndDialog(1); // tell dialog to end
- g_GraphVar = NULL; // set pointer to NULL to show no dialog running (dialog is still shutting down)
-
- }
- }