LONG CFlowDlg::OnComm(WPARAM ch,LPARAM port)
{
m_strEditReceiveMSG+=ch;
UpdateData(FALSE);
return 0;
}
我參考龔建偉老師的資料寫的,我對單片機發來的資料做了定義,右邊的資料應該是實時改變的,但是編輯框中只顯示第一次打開串口時候的資料,并不會更新資料,怎么解決,跪求幫助。。。

uj5u.com熱心網友回復:
CWnd::UpdateDataBOOL UpdateData( BOOL bSaveAndValidate = TRUE );
Return Value
Nonzero if the operation is successful; otherwise 0. If bSaveAndValidate is TRUE, then a return value of nonzero means that the data is successfully validated.
Parameters
bSaveAndValidate
Flag that indicates whether dialog box is being initialized (FALSE) or data is being retrieved (TRUE).
Remarks
Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.
The framework automatically calls UpdateData with bSaveAndValidate set to FALSE when a modal dialog box is created in the default implementation of CDialog::OnInitDialog. The call occurs before the dialog box is visible. The default implementation of CDialog::OnOK calls this member function with bSaveAndValidate set to TRUE to retrieve the data, and if successful, will close the dialog box. (If the Cancel button is clicked in the dialog box, the dialog box is closed without the data being retrieved.)
CWnd Overview | Class Members | Hierarchy Chart
See Also CWnd::DoDataExchange
uj5u.com熱心網友回復:
OnComm函式進來了嗎?跟蹤一下,看看字串有沒有變化,另外,如果你需要UpdateData(FALSE);來更新界面,那你m_strEditReceiveMSG是系結該edit的變數嗎?
uj5u.com熱心網友回復:
我是在變數添加界面系結了edit編輯框
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/139728.html
標籤:基礎類
上一篇:CString輸出問題
下一篇:PDFlib如何輸出簡體中文
