// WDGThrd.cpp : implementation file // #include "stdafx.h" #include "PCIWDG.h" #include "WDGThrd.h" #include "WDG.h" #include "PWDGDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // WDGThread IMPLEMENT_DYNCREATE(WDGThread, CWinThread) WDGThread::WDGThread() { } WDGThread::~WDGThread() { } BOOL WDGThread::InitInstance() { // TODO: perform any per-thread initialization here return TRUE; } int WDGThread::ExitInstance() { // TODO: perform any per-thread cleanup here return CWinThread::ExitInstance(); } BEGIN_MESSAGE_MAP(WDGThread, CWinThread) //{{AFX_MSG_MAP(WDGThread) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // WDGThread message handlers int WDGThread::Run() { char IRQ_Occurred; char text[64]; Data = 0; sprintf (text, " Status: %2.2x", Data); ((CPCIWDGDlg*)MainWnd)->m_StatusByte = text; MainWnd->UpdateData(false); IRQ_Occurred = WDGGetStatus(&Data); if (IRQ_Occurred) { sprintf (text, " Status: %2.2x", Data); ((CPCIWDGDlg*)MainWnd)->m_StatusByte = text; MainWnd->UpdateData(false); } return CWinThread::Run(); } void WDGThread::InitWnd(HWND hWnd) { MainWnd = CWnd::FromHandlePermanent(hWnd); }