Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

VC++: line break problem in edit box

Hi,

I am using ECC++ 4.0 and WinCE 4.2 emulator, I have create a unicode text file and the file contents is as below:
file content:
-----------
Testing123
Test456
Test789

I read the contents of the file and display in the multiline edit box. The result is as below:

Testing123□Test456□Test789□

But this is not the result that I expect, how should I display in edit box as below:

Testing123
Test456
Test789

I had tried to use AfxMessageBox() to display the result and it give me the correct result.

Below is my code:
================================================== =======

CStudioFile f;
CString s;
char asciibuff[4096];

m_sListSerial = _T("");
if (f.Open(L"serialno.txt", CFile::modeRead | CFile::shareExclusive | CFile::typeText))
{
while(f.ReadString(s,true))
{
m_sListSerial += s;
}
f.Close();

AfxMessageBox(m_sListSerial);
WideCharToMultiByte(CP_ACP, 0, m_sListSerial, -1, asciibuff, 4096, NULL, NULL);

m_sSerialNo = asciibuff;
UpdateData (FALSE);
}

================================================== =======

Can someome please help. Thanks in advance.

Best Regards
Sign In or Register to comment.