-
March 12th, 2012, 09:08 AM
#1
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
-
March 13th, 2012, 02:52 AM
#2
Re: toolbar not being loaded for dialog dll---extension dll
Being here in CG since 2007 but still not knowing how to use Code tags?
Did you debug your code?
Victor Nijegorodov
-
March 13th, 2012, 03:53 AM
#3
Re: toolbar not being loaded for dialog dll---extension dll
check if you have an instance of the toolbar before you are creating it..
something like this
Code:
m_FirstToolBar = new CToolbar();
Last edited by vcdebugger; March 13th, 2012 at 03:57 AM.
-
March 13th, 2012, 01:02 PM
#4
Re: toolbar not being loaded for dialog dll---extension dll
Have a look in resource.h, both in DLL and application project and asure they have not duplicate resource ID values.
This is one common problem when we are dealing with MFC extension DLLs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|