toolbar not being loaded for dialog dll---extension dll
-
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
-
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
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
-
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
I want to call this dialog from another mfc application, it loads fine working properly. only the toolbar is not coming.
-
I want to call this dialog from another mfc application, it loads fine working properly. only the toolbar is not coming.
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