MS VC++ / CControlBar object problem
Posted on 1998-10-13
I have problem using CControlBar as a child of CFrameWnd. I use CFrameWnd object on my own - I do not use App wizard code whitch includes View / Document support, whitch I do not want use. I use "hand wizard" code, whitch just only create CWndApp object and on its initialization CFrameWnd object as the main application window.
All works correctly without the CControlBar object (its CControlBar and CStatusBar derived objects exactly), created as a child of the CFrameWnd object. The CControlBar object is functional expect one cosmetic mistake:
It is viewed in the level of client area of this CFrameWnd object window. Normally it is bulging, so it looks as part of the frame. (For exact imagination - the CControlBar is viewed just as a scroll bar - i do not meen the buttons of scroll bar, but the light gray part of the scroll bar).
App wizard creates code, whitch works correctly, but I can not use it as a sample, because it uses some dynamic object creation magic.
Parts of code, whitch results is this problem:
// CControlBar initialization code
int CFrameWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
// T O O L B A R C R E A T I O N
if (!_ToolBar.Create(this, WS_CHILD |
WS_VISIBLE | CBRS_TOP | WS_DLGFRAME ,
_IDW_CONTROLBAR_FIRST + 10)
CBRS_TOOLTIPS | CBRS_FLYBY |
CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS |
// CFrameWnd Initialization Code
// - parent of CControlBar object
_FrameMainP = new CFrameMain;
m_pMainWnd = _FrameMainP;
WS_OVERLAPPEDWINDOW, // dwStyle
CFrameWnd::rectDefault, // default rectangle
NULL, // parent wnd
MAKEINTRESOURCE(IDR_MENU), // menu