Solved

Accessing CEdit in CDialogBar

Posted on 1999-01-29
2
281 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 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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

615 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