Solved

Initializing MultiLine CEdit control

Posted on 1998-12-13
2
448 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 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