Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. toolbar not being loaded for dialog dll---extension dll

toolbar not being loaded for dialog dll---extension dll

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    appollosputnik
    wrote on last edited by
    #1

    i have created an extension dll. where i am loading a dialog from the client mfc application. My dialog has all menubar, toolbar, view. the dll dialog is being loaded but the toolbar is not coming. toolbar is there of the client mfc applications toolbar. My dll dialog toolbar is not being shown. any suggestions what could be the problem??? Thanks in advance [code] BOOL CDlgsViewDlg::OnInitDialog() { CDialog::OnInitDialog(); m_pNewView = new CMyView(); ShowWindow(SW_SHOWMAXIMIZED); CRect clientRect; GetClientRect(&clientRect); clientRect.DeflateRect(10, 30); // Creation of the view window if(! m_pNewView->Create(NULL, NULL, WS_VISIBLE | WS_CHILD, clientRect, this, WM_USER)) { MessageBox(L"Failed to create view"); } menu.LoadMenu(IDR_MAINFRAME1); SetMenu(&menu); if(!m_FirstToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_FirstToolBar.LoadToolBar(IDR_TOOLBAR1)) { EndDialog(IDCANCEL); } RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0); m_wndStatusBar.Create(this); //We create the status bar m_wndStatusBar.SetIndicators(indicators,2); //Set the number of panes CRect rect; GetClientRect(&rect); //Size the two panes m_wndStatusBar.SetPaneInfo(0,ID_INDICATOR_NISH, SBPS_NORMAL,rect.Width()-100); m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_TIME,SBPS_STRETCH ,0); //This is where we actually draw it on the screen RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST, ID_INDICATOR_TIME); m_wndStatusBar.SetPaneText(0,L"MainWindow Initialized"); if(!fileName.IsEmpty()) { m_pNewView->loadProfile(fileName); m_pNewView->domainSetUpForProfile(); m_pNewView->drawLines(); m_pNewView->drawArcs(); m_pNewView->drawProfile(); m_pNewView->isModel=true; m_pNewView->OnGeneratesurface(); m_pNewView->OnShade(); m_pNewView->OnIsosouthwest(); } return TRUE; // return TRUE unless you set the focus to a control } [\code] This is the OnInitDialog of my dll dialog where i am loading everything menubar, toolbar calliing some functions etc. Please help

    L 1 Reply Last reply
    0
    • A appollosputnik

      i have created an extension dll. where i am loading a dialog from the client mfc application. My dialog has all menubar, toolbar, view. the dll dialog is being loaded but the toolbar is not coming. toolbar is there of the client mfc applications toolbar. My dll dialog toolbar is not being shown. any suggestions what could be the problem??? Thanks in advance [code] BOOL CDlgsViewDlg::OnInitDialog() { CDialog::OnInitDialog(); m_pNewView = new CMyView(); ShowWindow(SW_SHOWMAXIMIZED); CRect clientRect; GetClientRect(&clientRect); clientRect.DeflateRect(10, 30); // Creation of the view window if(! m_pNewView->Create(NULL, NULL, WS_VISIBLE | WS_CHILD, clientRect, this, WM_USER)) { MessageBox(L"Failed to create view"); } menu.LoadMenu(IDR_MAINFRAME1); SetMenu(&menu); if(!m_FirstToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_FirstToolBar.LoadToolBar(IDR_TOOLBAR1)) { EndDialog(IDCANCEL); } RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST,0); m_wndStatusBar.Create(this); //We create the status bar m_wndStatusBar.SetIndicators(indicators,2); //Set the number of panes CRect rect; GetClientRect(&rect); //Size the two panes m_wndStatusBar.SetPaneInfo(0,ID_INDICATOR_NISH, SBPS_NORMAL,rect.Width()-100); m_wndStatusBar.SetPaneInfo(1,ID_INDICATOR_TIME,SBPS_STRETCH ,0); //This is where we actually draw it on the screen RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST, ID_INDICATOR_TIME); m_wndStatusBar.SetPaneText(0,L"MainWindow Initialized"); if(!fileName.IsEmpty()) { m_pNewView->loadProfile(fileName); m_pNewView->domainSetUpForProfile(); m_pNewView->drawLines(); m_pNewView->drawArcs(); m_pNewView->drawProfile(); m_pNewView->isModel=true; m_pNewView->OnGeneratesurface(); m_pNewView->OnShade(); m_pNewView->OnIsosouthwest(); } return TRUE; // return TRUE unless you set the focus to a control } [\code] This is the OnInitDialog of my dll dialog where i am loading everything menubar, toolbar calliing some functions etc. Please help

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This looks like a very complicated way to start a Windows application. Why not just use the standard Framework - View model that has been used since Windows first appeared?

      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

      A 1 Reply Last reply
      0
      • L Lost User

        This looks like a very complicated way to start a Windows application. Why not just use the standard Framework - View model that has been used since Windows first appeared?

        Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

        A Offline
        A Offline
        appollosputnik
        wrote on last edited by
        #3

        I want to call this dialog from another mfc application, it loads fine working properly. only the toolbar is not coming.

        L 1 Reply Last reply
        0
        • A appollosputnik

          I want to call this dialog from another mfc application, it loads fine working properly. only the toolbar is not coming.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          It's difficult to suggest anything but it may have something to do with the RepositionBars() calls. You should try a bit of debugging to see what is happening at each step in this function.

          Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups