Hi,
Read serial process done by thread and write serial process
done by millisecond timer (ex: 1000Millisec) and store it to
edit control - serialdata[datalimit++]. Here, datalimit = 8192.
datalimit increment by 1 for every serial read process and
reset by 0 when reached the limit 8192. SetTimer(1, 500, NULL)
called when read serial process start for update the data
serialdata[datalimit++] in edit control.
Some times serial data stores
serialdata[i] = îþîþîþîþîþîþîþîþîþîþîþîþçÅk. That time error
occured.
I don't know why the data was loading like that. But for avoid
i changed my code like below,
Program: C:\Windows\SYSTEM32\mfc110d.dll
File: f:\dd\vctools\vc7libs\ship\atlmfc\include\atlsimpstr.h
Line: 427
What is the reason for this?
Even i never write the edit while receive junk/special char?
pls find the attachment and do needful.
Read serial process done by thread and write serial process
done by millisecond timer (ex: 1000Millisec) and store it to
edit control - serialdata[datalimit++]. Here, datalimit = 8192.
datalimit increment by 1 for every serial read process and
reset by 0 when reached the limit 8192. SetTimer(1, 500, NULL)
called when read serial process start for update the data
serialdata[datalimit++] in edit control.
Some times serial data stores
serialdata[i] = îþîþîþîþîþîþîþîþîþîþîþîþçÅk. That time error
occured.
I don't know why the data was loading like that. But for avoid
i changed my code like below,
Code:
DDX_Text(pDX, IDC_EDIT1, m_vserialdata);
if(nIDEvent == 1)
{
m_vserialdata = "";
for(int i=0; i< datalimit; i++)
{
// Error, Length < 0 , serialdata[i] =
îþîþîþîþîþîþîþîþîþîþîþîþçÅk
//m_vserialdata += serialdata[i];
if(serialdata[i].GetLength() >= 0) m_vserialdata
+= serialdata[i];
else TRACE("\n i=%d, Length < 0 = %s",i,
serialdata[i]);
}
UpdateData(false);
}
Program: C:\Windows\SYSTEM32\mfc110d.dll
File: f:\dd\vctools\vc7libs\ship\atlmfc\include\atlsimpstr.h
Line: 427
What is the reason for this?
Even i never write the edit while receive junk/special char?
pls find the attachment and do needful.