RE: How to get a reference to the CMainFrame in one of its children?
Brock Davis <
brock@...>
2001-09-05 21:01:21 GMT
Well, the easy way is to cheat and create a global pointer to CMainFrame.
Then you can call any method you want.
Or, since you have the window handles, you can post a user message to the
mainframe window handle. But then you have to define a user message for
each method you want to invoke.
On how you are attaching to the different objects, I think that works fine
to create an instance of the standard CWindow object, but will not allow you
to get any special methods, such as SetStatusBar. In other words, when you
finally attach "mainFrame.Attach(topSplitWnd.GetParent());" this will not
give you an instance of your real mainframe, so you will not have the
m_statusBar object. I'm probably mistaken, but I think that is true.
Brock Davis
brock@...
yahoo! id: brocktriplets
404-495-3440
-----Original Message-----
From: new2wtl@... [mailto:new2wtl <at> yahoo.com]
Sent: Monday, August 20, 2001 1:55 PM
To: wtl@...
Subject: [wtl] How to get a reference to the CMainFrame in one of its
children?
I have a child control that's a great-great-grand child of its
CMainFrame (it's inside a CWindow that's inside another CWindow
that's inside a CSplitterWindow that's inside the CMainFrame). What I
need is whenever the user moves the mouse over it, the status bar
displays certain information. In CMainFrame I have a method:
(Continue reading)