Hi I'm having a problem with my single-document MFC application.
I want to add my own toolbar to MainFrm class (CFrameWnd).
I am a total newb with MFC. So I'm not sure that's even the place to add it.
So far:
A toolbar resource with id IDR_TOOLBAR1 is created
A toolbarbutton with id ID_SELECT_SHAPE
In MainFrm.h is CToolBar m_wndMyToolBar; declared
In MainFrm.cpp:
if (!m_wndMyToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndMyToolBar.LoadToolBar(IDR_TOOLBAR1))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
The toolbar is showing now. YAY!
But I don't know how to add the event handler.
Somebody who can tell if I'm on the right track? And if so, who can tell how to add that event?