Solved

Initializing MultiLine CEdit control

Posted on 1998-12-13
2
405 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
Comment Utility
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
Comment Utility
OK I got it. Thank you, Answer2000
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 83
isEverywhere  challenge 19 62
java ^ examples 8 57
ShiftLeft challenge 21 65
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now