Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Accessing CEdit in CDialogBar

Posted on 1999-01-29
2
Medium Priority
?
283 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
[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 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 400 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

688 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