CompuServe Thread

#Remove Menu Bar?

2 messages in this thread
#30296From: Ed DoreJul 8, 1994 1:07 PM
Hi Robin, CMDIChildWnd is a "friend class" of CView, thus it is permitted access to CView's protected member functions. CView does not grant your CMDIChildWnd derived class friend status so your derived class cannot access CView's protected members. To get around this without modifying the MFC source, jufst declare a "public" OnActivate() function in your view class that calls the base class's OnActivate() function, and then use a pointer to your CView derived class instead of a generic CView pointer to invoke OnActivate(). For example: instead of usfing CView* pActiveView = GetActiveView(); try CMyView* pActiveView = (CMyView*)GetActiveView(); Sincerely, Ed Dore Microsoft Developer Support
#30308From: Robin CollinsJul 8, 1994 3:16 PM
Thanks for the C++ lesson (no, really!), I hadn't come across the technique of declaring a public function in a derived class simply to 'expose' a protected member of a base class. Appreciate the help. Robin