bcgcontrolbar 를 사용하기 전에 프로젝트를 BCG 프로젝트로 수정해야 합니다.
add bcgcbpro directory to include path < That you call afxoleinit () in your application initinstance ()
add the following include to the STD afx.h. Include "bcgcbproinc.h"
add cbcgpworkspace-derivation to your application class:
public cbcgpworkspace
first, You need to define where your customization data will be saved in the registry and which optional customization features (mouse, keyboard Context menus) will be required.to do it, in cmyapp:: initinstance set registry entry and initialize customization managers
//initialize customization managers:
initmousemanager ();
initcontextmenumanager ();
initkeyboardmanager ();
if you've decided to use either mouse or context menus customization, You need to "attach" a required views to the mouse customization manager and initialize context menus.override cbcgpworkspace: /p >
class cmyapp ...
{
...
가상 void preload
...
};
void cmyapp:: preload state ()
{
//associate mouse ever AddView (iIdTestView, _T("Test view "), IDR_VI
Ew);
//initializecontextmenus:
getcontextmenumanager ()-gt; Addmenu (_ t ("테스트 메뉴"), idmenu);
} P >
change cmdiframewnd to cbcgpmdiframewnd both in mainframe.h and mainframe.cpp files (in case of SDI application ches
change cmdichildwnd to cbcgpmdichildwnd
change ctoolbar to cbcgptoolbar and add an embedded medded //new menu bar
cbcgtoolbar m _ wnd toolbar; //application toolbar
in the cmainframe:: oncreate () method add the following lines to enable the mennes Create menu bar (replaces the standard menu):
if (! M _ wndmenubar.create (this)
{
trace 0 ("failed to create menubar")
리턴-1; //fail to create
}
m _ wndmenubar.setbarstyle (m _ wndmenubar.go
To enable menu bar docking, add the following code:
m _ wndmenubar.enable docking
dockcontrolbar (amp; M _ wndmenubar);