MFC :: Dialog ToolBar Won't Show Up ... ?

This is a discussion on MFC :: Dialog ToolBar Won't Show Up ... ? within the Windows Programming forums, part of the Platform Specific Boards category; Hi there. Thanks for reading, and I hope you can help me. I am creating an address book application, and ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question MFC :: Dialog ToolBar Won't Show Up ... ?

    Hi there. Thanks for reading, and I hope you can help me. I am creating an address book application, and it's an MFC Dialog-Based application. I created a toolbar resource item, and I am having some trouble with it. I added a 'CToolBar' class member in my dialog class header file. In the 'OnInitDialog' function, I am calling something similar to this:

    Code:
    // Some code here
    // ......
    
    // Attempt to create the toolbar
    if (! m_wndBar.CreateEx(/* Parameters here */) 
          || m_wndBar.LoadToolBar(IDR_MYTOOLBAR)) 
    {
        AfxMessageBox("Error creating toolbar.\n");    // Display error message
        return -1;      // Return '-1' (end application)
    }
    I do not get my error message, so I assume that the toolbar resource is created or loaded, but nothing shows up. I can display a menu ('CMenu *' class), but I can't get this to work.

    If you can help me in any way I would appreciate it.

    Thanks,
    Matt U.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >if (! m_wndBar.CreateEx(/* Parameters here */)
    > || m_wndBar.LoadToolBar(IDR_MYTOOLBAR))

    I could be misinterpreting this, as I know zilch about MFC, but shouldn't this be:
    if (! m_wndBar.CreateEx(/* Parameters here */)
    || ! m_wndBar.LoadToolBar(IDR_MYTOOLBAR))

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drawing, rubber banding in a dialog (MFC)?
    By MyglyMP2 in forum Windows Programming
    Replies: 2
    Last Post: 02-04-2009, 07:00 AM
  2. Editing the main dialog when starting from a VS MFC project?
    By Sfpiano in forum Windows Programming
    Replies: 3
    Last Post: 08-07-2005, 10:36 PM
  3. Resize Dialog Box via Code :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 10-27-2002, 10:00 PM
  4. MFC Dialog App Screen Refresh Question
    By Scotth10 in forum Windows Programming
    Replies: 2
    Last Post: 10-18-2002, 02:07 PM
  5. CListBox & Dialog Box :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 06-05-2002, 01:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21