|
-
September 10th, 1999, 09:13 AM
#1
How do I get a pointer to my Main Frame class?
How do I get a pointer to my main frame class. Specifically, I have a variable in my CMainFrm class that I want to set in my CView class. I need a pointer to my CMainFrame so I can type:
pMainFrm->variable = 0;
Right?
Thanks..
-
September 10th, 1999, 09:18 AM
#2
Re: How do I get a pointer to my Main Frame class?
Use the function AfxGetMainWnd(). You must cast the return value to your actual mainwindow class. For example:
((CMainFrame*)AfxGetMainWnd())->variable = 0;
-
September 10th, 1999, 09:18 AM
#3
Re: How do I get a pointer to my Main Frame class?
try like this :
CMyFrame * frame;
frame = (CMyFrame*)GetParent();
frame->variable = 0;
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
|