Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Initializing MultiLine CEdit control

Posted on 1998-12-13
2
Medium Priority
?
458 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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