Home > Software engineering >  I use the SerialPort class to write a serial port receives the data of small programs, data cannot b
I use the SerialPort class to write a serial port receives the data of small programs, data cannot b

Time:10-27

LONG CFlowDlg: : OnComm (WPARAM ch, LPARAM port)
{
M_strEditReceiveMSG +=ch;
The UpdateData (FALSE);
return 0;
}
My reference jian-wei gong teacher information written, I made a define the data from the microcontroller, the right of the data should be real time change, but only in the edit box shows for the first time open serial port data, do not update the data, how to solve, kneel down for help,,,

CodePudding user response:

The CWnd: : the UpdateData
BOOL the UpdateData (BOOL bSaveAndValidate=TRUE);

The 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.

The Parameters

BSaveAndValidate

Flag that are been dialog box is being initialized (FALSE) or data is being retrieved (TRUE).

Few

Call this member function to initialize the 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 the CWnd: : DoDataExchange

CodePudding user response:

OnComm function came in? To track it and see the string if there is any change, in addition, if you need the UpdateData (FALSE); To update the interface, you
The variable m_strEditReceiveMSG is binding the edit?

CodePudding user response:

refer to the second floor jason_wentzel response:
OnComm function came in? To track it and see the string if there is any change, in addition, if you need the UpdateData (FALSE); To update the interface, you
The variable m_strEditReceiveMSG is binding the edit?

I am in the variable to add interface binding the edit edit box
  • Related