Bonjour!
J'ai créé un CScrollView et j'ai mis le code suivant dans le OnCreate :
Le hic, c'est que ça plante au moment du CreateEx. Pourquoi? Est-ce impossible de mettre une toolbar sur autre chose qu'un CFrameWnd :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 //create toolbar tools BOOL bCreationDone = m_wndToolBar3D.CreateEx( this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_RIGHT | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(0,0,0,0), IDW_TOOLBAR_3DFRAME ); BOOL bLoadDone = m_wndToolBar3D.LoadToolBar(IDR_3DFRAME); if (bCreationDone && bLoadDone) { TRACE0("Failed to create toolbar 3D Frame\n"); return FALSE; // fail to create } //m_wndToolBar3D.AddDropDownButton(ID_TOOL_PROFILE_MONO, IDR_TOOLS_POPUP, TRUE,0); m_wndToolBar3D.SetWindowText("3D Frame tools"); m_wndToolBar3D.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT);
Y'a-t-il d'autres étapes que j'aurais zappé, parce que d'après la doc il suffit deet je crois avoir tout fait correctement...
- Create a toolbar resource.
- Construct the CToolBar object.
- Call the Create (or CreateEx) function to create the Windows toolbar and attach it to the CToolBar object.
- Call LoadToolBar to load the toolbar resource
Partager