Thread: howto put toolbar to dialog app

  1. #1
    arunkrsharma
    Guest

    Unhappy howto put toolbar to dialog app

    how do i put a tool bar into my dialog based application


    CToolBar * t_bar = new CToolBar();
    t_bar->CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE );
    t_bar->LoadToolBar(IDR_TOOLBAR1);

    but the tool bar just doesn't seems to load ... thanx a lot

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Try

    t_bar->LoadToolBar(MAKEINTRESOURCE(IDR_TOOLBAR1));
    if you created a toolbar with the resource editor.

    OR

    try casting the HMENU of CreateWindowEx() as the ID of the toolbar if you create it 'on the fly'

    ie (HMENU)IDR_TOOLBAR

    check that you have used ShowWindow(), UpdateWindow() after creating the toolbar.
    Last edited by novacain; 11-20-2001 at 02:08 AM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dialog Box error
    By JJFMJR in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2007, 07:51 AM
  2. Parent of a BrowseForFolder dialog box
    By @nthony in forum Windows Programming
    Replies: 4
    Last Post: 01-08-2007, 02:54 PM
  3. Splitting a dialog up into multiple classes
    By Just in forum Windows Programming
    Replies: 1
    Last Post: 05-29-2005, 11:11 PM
  4. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 02:42 PM
  5. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM