Jiqi1.cpp
资源名称:心跳检测.rar [点击查看]
上传用户:dtengfei
上传日期:2013-01-16
资源大小:393k
文件大小:1k
源码类别:
医药行业
开发平台:
Visual C++
- // Jiqi1.cpp : implementation file
- //
- #include "stdafx.h"
- #include "心跳检测.h"
- #include "Jiqi1.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CJiqi
- IMPLEMENT_DYNCREATE(CJiqi, CWinThread)
- CJiqi::CJiqi()
- {
- }
- CJiqi::~CJiqi()
- {
- }
- BOOL CJiqi::InitInstance()
- {
- // TODO: perform and per-thread initialization here
- return TRUE;
- }
- int CJiqi::ExitInstance()
- {
- // TODO: perform any per-thread cleanup here
- return CWinThread::ExitInstance();
- }
- BEGIN_MESSAGE_MAP(CJiqi, CWinThread)
- //{{AFX_MSG_MAP(CJiqi)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- ON_THREAD_MESSAGE(WM_CELIANG,Work)
- ON_THREAD_MESSAGE(WM_THREADEND,QuitPrg)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CJiqi message handlers
- void CJiqi::Work(LPARAM lParam)
- {
- struct ThreadPoint *TP;
- TP=(struct ThreadPoint *)lParam;
- CControl m_Dlg;
- int i;
- for(i=0;i<=TP->WholeNumber;i++)
- {
- if(TP->runing)
- {
- TP->data[i]=m_Dlg.Collectdata();
- TP->PointNumber=i;
- ::PostThreadMessage(m_MainThreadID,WM_REFRESH,NULL,NULL);
- Sleep(50);
- }
- else break;
- }
- TP->runing=FALSE;
- }
- void CJiqi::QuitPrg()
- {
- AfxEndThread(0);
- }