Pointer to the toolbar

This is a discussion on Pointer to the toolbar within the Windows Programming forums, part of the Platform Specific Boards category; How to get a pointer to the app's toolbar (CToolbar) from inside the view class of a MFC app?
thx....

The toolbar is not handled by the view class. It is handled by CFrameWnd which also handles docking. You can get a pointer to it by using AfxGetMainWnd() and typecasting the pointer to the type of your CFrameWnd derived class.

From there you can access CFrameWnd base class public funtions and data via the pointer as well as your derived class's public functions and data.