Solved

Accessing CEdit in CDialogBar

Posted on 1999-01-29
2
277 Views
Last Modified: 2013-11-20
I am having problems getting and setting text to edit controls in a dialog bar.

I have a CDialogBar with a few edit controls in the dialog resource.  In my CMainFrame class I have declared public CEdit member variables for these controls , and I invoke their Create() method in CMainFrame::OnCreate(), with the dialog bar class as the parent window and the appropriate resource ID from the dialog resource.

How do I get/set text to these edit controls ? SetWindowText() does not appear to be working. Do I need to subclass ? If so, what window do I subclass ?

Thanks.
0
Comment
Question by:xn12z9i
2 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1328534
Do you mind sending some piece of code of how you declare your controls and stuff?

-Viktor
--Ivanov
0
 
LVL 3

Accepted Solution

by:
luisr earned 100 total points
ID: 1328535
The problem is that you are creating some set of edit controls in the dialog resource, and again creating the,m programatically.

The solution is to call SubclassDlgItem instead of Create like this:

m_edit1.SubclassDlgItem(IDC_EDIT1, this);
m_edit2.SubclassDlgItem(IDC_EDIT2, this);

during the dialogbar initialization.


0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ShiftLeft challenge 21 82
FizzBuzz challenge 9 81
Execute multiple curl cmds with sleep and send output to file 10 97
Annoying "thing" blocks my view 4 100
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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