Problem with Visual studio 2008 feature pack's CMFCToolBar - not being displayed
-
Hello, I'm upgrading my MFC application to make use of some of the new user interface elements from the Visual studio 2008 feature pack. My first concern is upgrading my CToolBar to the pack's new CMFCToolBar, to use large icons, rollover buttons, etc. I use much the same boilerplate code in CMainFrame::OnCreate() as ever:
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;// I've attempted to simplify the code to the greatest possible extent to isolate the problem:
// The this pointer points to CMainFrame class which extends the CFrameWnd class.
if (!m_wndToolBar.CreateEx (this, TBSTYLE_TRANSPARENT) ||
!m_wndToolBar.LoadToolBar (IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}However, no toolbar is visible when the application starts - it is simply omitted. Switching the class of m_wndToolBar from CMFCToolBar back to CToolBar once again makes the toolbar visible. Why might the framework fail to display my CMFCToolBar? How can I fix the problem? Regards, Sternocera
-
Hello, I'm upgrading my MFC application to make use of some of the new user interface elements from the Visual studio 2008 feature pack. My first concern is upgrading my CToolBar to the pack's new CMFCToolBar, to use large icons, rollover buttons, etc. I use much the same boilerplate code in CMainFrame::OnCreate() as ever:
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;// I've attempted to simplify the code to the greatest possible extent to isolate the problem:
// The this pointer points to CMainFrame class which extends the CFrameWnd class.
if (!m_wndToolBar.CreateEx (this, TBSTYLE_TRANSPARENT) ||
!m_wndToolBar.LoadToolBar (IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}However, no toolbar is visible when the application starts - it is simply omitted. Switching the class of m_wndToolBar from CMFCToolBar back to CToolBar once again makes the toolbar visible. Why might the framework fail to display my CMFCToolBar? How can I fix the problem? Regards, Sternocera
this new feature pack stores the settings under the registry, so delete the workspace registry key under ur app key and try. alternatively in initinstance() u can call cleanState(). if this doesnt work then try creating a new sample toolbar and check if it works. enjoy Pras