?
Solved

Initializing MultiLine CEdit control

Posted on 1998-12-13
2
Medium Priority
?
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 150 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 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