How to use CDialogBar in MDI application?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: How to use CDialogBar in MDI application?

  1. #1
    Join Date
    Jan 2004
    Location
    Czech Republic, Brno
    Posts
    20

    How to use CDialogBar in MDI application?

    I have generated MDI application by means of MFC AppWizard. Then I have inserted in MainFrame.h in declaration of class CMainFrame the variable:

    protected:
    CDialogBar m_wndMainMenu;

    I want to use m_wndMainMenu CMainFrame::OnCreate
    ( m_wndMainMenu.Create(this, IDD_MAIN_MENU,
    CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY, IDD_MAIN_MENU)

    Program can be build, but it crashes in InitInstance() of the App in the line

    if (!pMainFrame->LoadFrame(IDR_MAINFRAME))

    When I define CDialogBar m_wndMainMenu as a pointer, then I call new for this variable in CMainFrame::CMainFrame(), program doesn't crush. I call delete of varible in CMainFrame::~CMainFrame(). But IDE detects memory leaks.

    When I use CDialogBar in ChildFrame, it works fine.

    Do you know how CDialogBar can be used in MainFrame of MDI application?

  2. #2
    Join Date
    Jan 2004
    Location
    Czech Republic, Brno
    Posts
    20

    Added project files

    I have atached zipped project files (19 kB)
    Attached Files Attached Files

  3. #3
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: How to use CDialogBar in MDI application?

    Works well for me. I just built your app and executed , both Debug and Release version.

  4. #4
    Join Date
    Jan 2004
    Location
    Czech Republic, Brno
    Posts
    20

    Re: How to use CDialogBar in MDI application?

    I am sorry for posting this thread. When I rebuild all files, it works well. Again, sorry.

  5. #5
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: How to use CDialogBar in MDI application?

    No problem. Good that u can proceed now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center