CompuServe Messages

#Remove Menu Bar?

    08-Jul-94 13:07:11
Sb: #29533-#Remove Menu Bar?
Fm: Ed Dore 72262,1577
To: Robin Collins 100015,416
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