Solved

Initializing MultiLine CEdit control

Posted on 1998-12-13
2
430 Views
Last Modified: 2013-11-20
I use a MultiLine CEdit. I want to initialize it with some text lines contained in a CString array. How can I do. I used PostMessage to post WM_CHAR messages, but there's some characters displayed incorrectly. How can I access the buffer of CEdit control? And the format (or structure) of that buffer?
0
Comment
Question by:daitt
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
ID: 1326146
Just use the SetWindowText member to set the text, use GetWindowText to get the text.  These are both members of CWnd (the base class of CEdit)

e.g.
m_edit.SetWindowText( "Hello\r\nWorld" ) ; // m_edit is a CEdit for the control.

It's a NUL terminated string, The SetWindowText/GetWindowText functions allow you to set/get a NUL terminated string or a CString.

BTW use CR/LF sequence to break lines, that's "\r\n"
0
 
LVL 3

Author Comment

by:daitt
ID: 1326147
OK I got it. Thank you, Answer2000
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 49
bobThere java chalenge 45 94
Doc'in system (example?) BA 7 115
Fibonacci challenge 11 132
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question