1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
static VOID CALLBACK TimerProc(HWND /*hwnd*/,UINT /*uMsg*/,UINT_PTR /*idEvent*/,DWORD /*dwTime*/);
InstantResult::InstantResult(CWnd* pParent /*=NULL*/)
: CDialog(InstantResult::IDD, pParent)
{
//m_IdTimer=::SetTimer(NULL,0,1000,TimerProc); // création d'un timer qui bat à la seconde
}
void InstantResult::OnBnClickedButton2()
{
// TODO: Add your control notification handler code here
KillTimer(m_IdTimer); // pour arreter le timer
}
VOID CALLBACK TimerProc(HWND /*hwnd*/,UINT /*uMsg*/,UINT_PTR /*idEvent*/,DWORD /*dwTime*/)
{
// ici la procédure du timer
unsigned char Authmov[1]={140}; // authorization to move command
CCom::ClosePortCom();
CCom::InitPortCom();
WriteFile(hcom,Authmov, 1, &m, NULL);
CCom::ReadBuffer();
} |