GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Apr-2005, 15:21
Arbo Arbo is offline
New Member
 
Join Date: Apr 2005
Posts: 1
Arbo is on a distinguished road
Question

How to update the child dialog box


Hi! I am new to VC++. Right now, I have created a child dialog box using CDialog, and then what I want to do is to display a message (in form of text fileld - m_info)in the child dialog box when a button is clicked, where the displayed message is from the parent dialog box.

CPP / C++ / C Code:
void CParent::OnCreateChild() 
{
	CDialog dlg2(IDD_DIALOG2, this);
	dlg2.DoModal();
}

void CChild::OnButton() 
{
	m_info = parent.message;
	UpdateData(FALSE);
}

I could not update the textfiled in the child dialog box, do I have to set up something in order to get the message from the parent dialog box?

Thanks.
Last edited by LuciWiz : 04-Apr-2005 at 23:56. Reason: Please insert your C++ code between [c++] & [/c++] tags
  #2  
Old 01-Jun-2005, 13:25
robi123 robi123 is offline
New Member
 
Join Date: May 2005
Posts: 2
robi123 is on a distinguished road
You can use function
SetDlgItemText( int nID, LPCTSTR lpszString );

nID-Identifies the control whose text is to be set.

lpszString-Points to a CString object or null-terminated string that contains the text to be copied to the control.
 
 

Recent GIDBlogToyota - 2008 September Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dialog based application hezyse MS Visual C++ / MFC Forum 1 20-Mar-2005 18:16
How can I change the class of a dialog ? Frandy MS Visual C++ / MFC Forum 0 28-Feb-2005 02:24
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 03:38
controling dialog objects & multiple source files omills MS Visual C++ / MFC Forum 0 14-Jul-2004 23:30
Google Update and DeepCrawl Alert JdS Search Engine Optimization Forum 24 16-Aug-2003 05:35

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 13:47.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.