He can also use this class to send a message directly to the "CClassView".
AliR.
Ravnock wrote:
First of all, thanks to everybody for the help. I'm a newbie and I'm a
bit lost.
CClassView : public CMFCToolBar, the propetary of the CTreeCtrl object,
is a member of the
class CMainFrame : public CFrameWndEx
To show in the CTreeCtrl the document data, CClassView must have a
reference of the CDocument object or is there a better way?
Ravnock:
You should not refer to an object that is not derived from CView as a
view, nor give it a name like CClassView.
One (not very good OOP way) would be to do, in your 3D render view:
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
Now you can call any method on the main window, and have the main window
update the tree view (which is the grand-child of the main window, if I am
understanding you).
A slightly better way (does not require casting) is to send a custom
message to the main window, to accomplish the same purpose.
CWnd::SendMessage() acts like a "universal virtual function" for any
CWnd-derived class.
--
David Wilkinson
Visual C++ MVP