BioSub-视图类OnTimer

设置定时器 定时40毫秒

void CScanViewerView::OnInitialUpdate()

{````

              SetTimer(0,40,NULL);

 ````

}

 

想象成一个水池子,

pDoc->AddFrames(&(pIO->pInBuffer[0]),dwCurNum);往水池注水(加入数据)

void CScanViewerView::OnTimer(UINT nIDEvent) 从水池放水(取出数据)。

void CScanViewerView::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default CString str = ""; char str1[10]; CScanViewerDoc* pDoc = GetDocument(); CDataFrame * m_Frame = NULL; for (int wIndex = pLstRxd->GetCount();wIndex < pDoc->m_ObArray.GetSize();wIndex++) { m_Frame = (CDataFrame *)pDoc->m_ObArray.GetAt(wIndex); str = ""; for(int ii = 0;ii< 52 /*sizeof(m_Frame->m_bData)*/;ii++) { ::sprintf(str1,"%2.2X",m_Frame->m_bData[ii]); str += str1; str += " "; if(ii==3) str+= "|| "; if(ii==19) str+= "|| "; if(ii==35) str+= "|| "; } pLstRxd->AddString(str); } CView::OnTimer(nIDEvent); }

 

你可能感兴趣的:(null)