Tio wrote:
my code:
if (new data )
{
CString* pStr = (CString*)wPara m; //data come with some
com port (PostMessage)
CString p2Str; //old string in edit box
m_dataa.GetWind owText(p2Str);
*pStr= p2Str+*pStr; // add old string to new string
m_dataa.SetWind owText(*pStr); // send new string to edit box
delete pStr;
}
in first step I have in edit box "12345"
then come new data "6789"
so it should be after adding two string "12345 6789" in edit box but
is "12345 89"
why I lost two signs?
First of all, nothing in your code suggests you're adding a space between
your strings. Perhaps the operator+ for 'CString' does that, I don't know
since CString is not a standard class. Perhaps you're not telling us all
like it is in reality (like 'p2Str' actually contains a space after "5" or
that new data has a space in front of it).
Second, whatever you do that causes this malfunction, is most likely not
in this code, but rather outside, in the code you didn't post.
Third, your program's functionality depends on MFC (apparently), and this
is not the right place to discuss MFC issues. Try
'microsoft.publ ic.vc.mfc'.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask