// IRQThread.cpp : implementation file // #include "stdafx.h" #include "Sample 1.h" #include "IRQThread.h" #include "Sample 1Dlg.h" #include "aiowdm.h" extern signed long CardNum; extern BOOL GoFlag; //BOOL Terminated; #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // IRQThread IMPLEMENT_DYNCREATE(IRQThread, CWinThread) IRQThread::IRQThread() { Terminated = false; } IRQThread::~IRQThread() { } BOOL IRQThread::InitInstance() { // TODO: perform and per-thread initialization here return TRUE; } int IRQThread::ExitInstance() { // TODO: perform any per-thread cleanup here return CWinThread::ExitInstance(); } BEGIN_MESSAGE_MAP(IRQThread, CWinThread) //{{AFX_MSG_MAP(IRQThread) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // IRQThread message handlers int IRQThread::Run() { // TODO: Add your specialized code here and/or call the base class while (!Terminated) { if (GoFlag) { //NOTE: Synchronize is not needed unless you WaitForIRQ(CardNum); //call VCL functions in ISR. It is provided for CSample1Dlg::ISR(); //your convenience. } // end if } // end while return CWinThread::Run(); }