Click here to Skip to main content
15,919,331 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Line feed and Carriage return in Editbox Pin
Rajesh R Subramanian30-Jul-08 21:37
professionalRajesh R Subramanian30-Jul-08 21:37 
AnswerRe: Line feed and Carriage return in Editbox Pin
Iain Clarke, Warrior Programmer30-Jul-08 21:38
Iain Clarke, Warrior Programmer30-Jul-08 21:38 
GeneralRe: Line feed and Carriage return in Editbox Pin
sunny_vc30-Jul-08 22:27
sunny_vc30-Jul-08 22:27 
QuestionRe: Line feed and Carriage return in Editbox Pin
Rajesh R Subramanian30-Jul-08 22:39
professionalRajesh R Subramanian30-Jul-08 22:39 
AnswerRe: Line feed and Carriage return in Editbox Pin
sunny_vc30-Jul-08 22:45
sunny_vc30-Jul-08 22:45 
GeneralRe: Line feed and Carriage return in Editbox Pin
Rajesh R Subramanian30-Jul-08 22:55
professionalRajesh R Subramanian30-Jul-08 22:55 
AnswerRe: Line feed and Carriage return in Editbox Pin
CPallini30-Jul-08 23:40
mveCPallini30-Jul-08 23:40 
GeneralRe: Line feed and Carriage return in Editbox Pin
Iain Clarke, Warrior Programmer30-Jul-08 22:53
Iain Clarke, Warrior Programmer30-Jul-08 22:53 
My first thought was "Hmph, of course it works..."

But I thought I'd get some evidence before acting all superior.

This does not work:
CString buf;
buf += "Hello";
buf += char (10);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);

This does not work:
CString buf;
buf += "Hello";
buf += char (13);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);

This does not work:
CString buf;
buf += "Hello";
buf += char (10);
buf += char (13);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);

This works!
CString buf;
buf += "Hello";
buf += char (13);
buf += char (10);
buf += "There";
SetDlgItemText (IDC_EDIT7, buf);

Which comes as a bit of a surprise to me... Needing both CR and LF is no shock, but which order? Quite a surprise.

How you solve it is up to you really. Your reading from the UART routine could simply swap char(10) with char(13) and vice versa.

Or your routine that puts the text into the screen could.

You could put it in a string, and do a replace like so:
while (1)
{
   int nFind = MyString.Find ("\n\r");
   if (nFind < 0) break;
   MyString [nFind] = '\r';
   MyString [nFind+1] = '\n';
}


The choices are (near) endless.

Iain.
GeneralRe: Line feed and Carriage return in Editbox Pin
sunny_vc30-Jul-08 23:07
sunny_vc30-Jul-08 23:07 
QuestionHow can write data from one .mdb file to another? Pin
Le@rner30-Jul-08 21:13
Le@rner30-Jul-08 21:13 
AnswerRe: How can write data from one .mdb file to another? Pin
toxcct30-Jul-08 21:15
toxcct30-Jul-08 21:15 
GeneralRe: How can write data from one .mdb file to another? Pin
Le@rner30-Jul-08 21:26
Le@rner30-Jul-08 21:26 
QuestionRe: How can write data from one .mdb file to another? Pin
CPallini30-Jul-08 21:30
mveCPallini30-Jul-08 21:30 
AnswerRe: How can write data from one .mdb file to another? Pin
Le@rner30-Jul-08 21:48
Le@rner30-Jul-08 21:48 
GeneralRe: How can write data from one .mdb file to another? Pin
CPallini30-Jul-08 21:57
mveCPallini30-Jul-08 21:57 
GeneralRe: How can write data from one .mdb file to another? Pin
Le@rner31-Jul-08 1:20
Le@rner31-Jul-08 1:20 
GeneralRe: How can write data from one .mdb file to another? [modified] Pin
CPallini31-Jul-08 1:55
mveCPallini31-Jul-08 1:55 
GeneralRe: How can write data from one .mdb file to another? Pin
toxcct30-Jul-08 21:37
toxcct30-Jul-08 21:37 
GeneralRe: How can write data from one .mdb file to another? Pin
Le@rner30-Jul-08 21:50
Le@rner30-Jul-08 21:50 
GeneralRe: How can write data from one .mdb file to another? Pin
toxcct30-Jul-08 22:04
toxcct30-Jul-08 22:04 
GeneralRe: How can write data from one .mdb file to another? Pin
Le@rner31-Jul-08 1:25
Le@rner31-Jul-08 1:25 
AnswerRe: How can write data from one .mdb file to another? Pin
David Crow31-Jul-08 5:49
David Crow31-Jul-08 5:49 
Questionhow to access list box items of one dialog from another dialog box Pin
ab_pq30-Jul-08 20:56
ab_pq30-Jul-08 20:56 
AnswerRe: hi Pin
CPallini30-Jul-08 21:02
mveCPallini30-Jul-08 21:02 
GeneralRe: hi Pin
ab_pq30-Jul-08 21:08
ab_pq30-Jul-08 21:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.