Thread: Pointer to the toolbar

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Kurunegala Colony, Sri Lanka, Sri Lanka

    Pointer to the toolbar

    How to get a pointer to the app's toolbar (CToolbar) from inside the view class of a MFC app?
    Last edited by geek@02; 11-14-2006 at 09:52 AM.
    My amature IT Blog:
    My Flash games:

    (and, sorry for my amateur English)

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 10:10 AM
  2. Quick Pointer Question
    By gwarf420 in forum C Programming
    Replies: 15
    Last Post: 06-01-2008, 03:47 PM
  3. Parameter passing with pointer to pointer
    By notsure in forum C++ Programming
    Replies: 15
    Last Post: 08-12-2006, 07:12 AM
  4. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM