|
-
August 20th, 2002, 07:37 AM
#1
Variables in a Dialog app
I need to access the main window variables in a Dialog base app, from a child dialog. Can I access them directly or i need to create another variable and transfer its content?
Anyone could help me? Thanks in advance.
-
August 20th, 2002, 07:53 AM
#2
if your main window has public member variables, you can use it that way. If not, then you'll need either 1) access functions (like GetVariable1(), GetVariable2(), etc) or 2) make the dlg class a friend class to the parent window (not recommended).
What are you trying to do? If you give more information we can give you better advice!
-
August 20th, 2002, 08:38 AM
#3
Say you have 2 dialog classes, dialog1 and dialog2
//Within your dialog1.cpp:
dialog2 dlg;
dlg.DoModal();
// so you're saying from within dialog2.cpp you want to access variables from within dialog1?
//you can do something like this in dialog2.cpp
#include "dialog1.h"
diglag1* parentDlg=(dialog1*) GetParent();
parentDlg->/*access vars here*/
-
August 20th, 2002, 09:39 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|