Creating CStatusBar using GetStatusBarCtrl's create
Nanda -- nanda@genius.tisl.soft.net Wednesday, August 14, 1996 Environment: VC++ 4.0, NT 3.51 Hi, I am creating the status bar in a MDI application by calling the create function of CStatusBarCtrl inside the mainframe's OnCreate function. The status bar gets displayed in the DEBUG build, but in the release build the statusbar doesn't get displayed. Can any one tell me the reason why it happens? Thanx in advance Code : CMainFrame::CFrameWnd { . . . CStatusBar m_wndStatusBar ; . . . } int CMainFrame::OnCreate() { . . . if ( m_wndStatusBar.GetStatusBarCtrl().Create(WS_CHILD | WS_VISIBLE | CCS_BOTTOM, this, rect, ID_STATUSBAR) == FALSE ) { TRACE0("Failed to create statusbar\n"); return -1 ; } . . . . } Nanda
Jaideep Tolani -- jtolani@fedex.com Saturday, August 17, 1996 Nanda wrote: > > Environment: VC++ 4.0, NT 3.51 > > Hi, > I am creating the status bar in a MDI application by calling the > create function of CStatusBarCtrl inside the mainframe's OnCreate > function. The status bar gets displayed in the DEBUG build, but in the > release build the statusbar doesn't get displayed. Can any one tell me the > reason why it happens? > > Thanx in advance > > Code : > > CMainFrame::CFrameWnd > { > . > . > . > CStatusBar m_wndStatusBar ; > . > . > . > } > > int CMainFrame::OnCreate() > { > . > . > . > if ( m_wndStatusBar.GetStatusBarCtrl().Create(WS_CHILD | WS_VISIBLE | > CCS_BOTTOM, this, rect, ID_STATUSBAR) == FALSE ) > { > TRACE0("Failed to create statusbar\n"); > return -1 ; > } > . > . > . > . > } > > Nanda You might wanna try using CStatusBarCtrl object directly instead of CStatusBar ie (Mainfrm.h) CStatusBarCtrl m_wndStatusBarCtrl; (Mainfrm.cpp) if ( m_wndStatusBarCtrl.Create(WS_CHILD | WS_VISIBLE |CCS_BOTTOM, rect,this, ID_STATUSBAR) == FALSE ) { TRACE0("Failed to create statusbar\n"); return -1 ; }
| Вернуться в корень Архива |