MFC, vc serial data, now I have been using a serial port receives the data and shows, and then I'd like to have these data is displayed in a receiving box, at the same time in more than one displayed in the edit box, how can I add a program, for a great god! Grateful, here is my original serial program
If (m_mscom get_CommEvent ()==2)
{
Char STR [1024]={0};
Long k;
The VARIANT InputData=https://bbs.csdn.net/topics/m_mscom.get_Input ();//read buffer
COleSafeArray fs.
Fs=InputData;//the VARIANT type variable converting a quantity COleSafeArray type variable
For (k=0; k
Fs. GetElement (& amp; K, STR + k);//type into a BYTE array
M_EditReceive +=STR;//receive the edit box inside
//SetTimer (1, 10, NULL);//delay 10 ms
The UpdateData (false);
}
CodePudding user response:
M_EditReceive +=STR;//receive the edit box inside For_each (m_OtherEditsText) M_OtherEditsText +=STR; //SetTimer (1, 10, NULL);//delay 10 ms The UpdateData (false); CodePudding user response:
refer to the original poster tanghong6814 response: , MFC vc serial data, now I have been using a serial port receives the data and shows, and then I'd like to have these data is displayed in a receiving box, at the same time in more than one displayed in the edit box, how can I add a program, and a great god! Grateful, here is my original serial program If (m_mscom get_CommEvent ()==2) { Char STR [1024]={0}; Long k; The VARIANT InputData=https://bbs.csdn.net/topics/m_mscom.get_Input ();//read buffer COleSafeArray fs. Fs=InputData;//the VARIANT type variable converting a quantity COleSafeArray type variable For (k=0; k Fs. GetElement (& amp; K, STR + k);//type into a BYTE array M_EditReceive +=STR;//receive the edit box inside //SetTimer (1, 10, NULL);//delay 10 ms The UpdateData (false); } Seems a bit see what you mean, You also add a lot of edit box? There is always a limit to the amount of the edit box? If filled? Keep only the latest of several? If so, then you can refer to the following code: M_editArray [100]={};//window initialization, edit box to initialize array, let's say you have 100 For (int I=99; i> 0; I -) {//replace the old one by one content M_editArray [I]=m_editArray [I - 1); } M_editArray [0]=STR;//the contents of the latest CodePudding user response:
refer to the second floor zjq9931 response: Quote: refer to the original poster tanghong6814 response: MFC, vc serial data, now I have been using a serial port receives the data and shows, and then I'd like to have these data is displayed in a receiving box, at the same time in more than one displayed in the edit box, how can I add a program, for a great god! Grateful, here is my original serial program If (m_mscom get_CommEvent ()==2) { Char STR [1024]={0}; Long k; The VARIANT InputData=https://bbs.csdn.net/topics/m_mscom.get_Input ();//read buffer COleSafeArray fs. Fs=InputData;//the VARIANT type variable converting a quantity COleSafeArray type variable For (k=0; k Fs. GetElement (& amp; K, STR + k);//type into a BYTE array M_EditReceive +=STR;//receive the edit box inside //SetTimer (1, 10, NULL);//delay 10 ms The UpdateData (false); } Seems a bit see what you mean, You also add a lot of edit box? There is always a limit to the amount of the edit box? If filled? Keep only the latest of several? If so, then you can refer to the following code: M_editArray [100]={};//window initialization, edit box to initialize array, let's say you have 100 For (int I=99; i> 0; I -) {//replace the old one by one content M_editArray [I]=m_editArray [I - 1); } M_editArray [0]=STR;//the contents of the latest How to put this array is assigned to the content of the edit box, and display the ah, I'm a small white one CodePudding user response:
reference 1st floor kongl123 response: M_EditReceive +=STR;//receive the edit box inside For_each (m_OtherEditsText) M_OtherEditsText +=STR; //SetTimer (1, 10, NULL);//delay 10 ms The UpdateData (false); Don't read it.. CodePudding user response:
Figure above CodePudding user response:
It is a long story, contact me CodePudding user response:
reference tanghong6814 reply: 3/f Quote: refer to the second floor zjq9931 response: The Quote: refer to the original poster tanghong6814 response: MFC, vc serial data, now I have been using a serial port receives the data and shows, and then I'd like to have these data is displayed in a receiving box, at the same time in more than one displayed in the edit box, how can I add a program, for a great god! Grateful, here is my original serial program If (m_mscom get_CommEvent ()==2) { Char STR [1024]={0}; Long k; The VARIANT InputData=https://bbs.csdn.net/topics/m_mscom.get_Input ();//read buffer COleSafeArray fs. Fs=InputData;//the VARIANT type variable converting a quantity COleSafeArray type variable For (k=0; k Fs. GetElement (& amp; K, STR + k);//type into a BYTE array M_EditReceive +=STR;//receive the edit box inside //SetTimer (1, 10, NULL);//delay 10 ms The UpdateData (false); } Seems a bit see what you mean, You also add a lot of edit box? There is always a limit to the amount of the edit box? If filled? Keep only the latest of several? If so, then you can refer to the following code: M_editArray [100]={};//window initialization, edit box to initialize array, let's say you have 100 For (int I=99; i> 0; I -) {//replace the old one by one content M_editArray [I]=m_editArray [I - 1); } M_editArray [0]=STR;//the contents of the latest How to put this array is assigned to the content of the edit box, and display the ah, I be a small white Give each edit box to create a variable, this will be? Then, the establishment of an edit box pointer array; Each edit box store Pointers to array, And then use my code the principle, To pay attention to: Is variable, the edit box Control type or, cstrings type? nullnullnull