Solved

Accessing CEdit in CDialogBar

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 87
Host to IP 7 73
dog bark java program 15 82
lucky13 challenge 11 112
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 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

20 Experts available now in Live!

Get 1:1 Help Now