Get ChildFrame from CDocument (MDI app)
-
Hello, This should be an easy one, but I can't seem to figure it out. In my CDocument class, I want to get a pointer to my CChildFrame. Is this possible? Thanks in advance
This should help:
/** Returns a ptr to the first View containing this Document, or NULL if no View exists yet. * @see CEDDoc::FindVisibleView(), CEDDoc::GetBestView() */ CEDTextView* CEDDoc::GetFirstView() const { POSITION pos; return ( pos = GetFirstViewPosition() ) ne NULL ? dynamic_cast( GetNextView( pos ) ) : NULL; }
Then use: GetParentFrame() on the returned view, if !NULL. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com -
This should help:
/** Returns a ptr to the first View containing this Document, or NULL if no View exists yet. * @see CEDDoc::FindVisibleView(), CEDDoc::GetBestView() */ CEDTextView* CEDDoc::GetFirstView() const { POSITION pos; return ( pos = GetFirstViewPosition() ) ne NULL ? dynamic_cast( GetNextView( pos ) ) : NULL; }
Then use: GetParentFrame() on the returned view, if !NULL. Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com