|
-
Dec 3rd, 2002, 11:06 AM
#1
Thread Starter
Lively Member
toolbar in dialog
I've made a program with MFC in visual C++ 6. then I tried to insert a toolbar. I've made one, IDC_TOOLBAR1. then I tried this code to place it in the dialog:
[code]
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
But when I run this code, I dont get a toolbar. what's wrong, or can anybody give me a little code example (if possible)?
thanks in advance
VIsualPenguin
-
Dec 4th, 2002, 09:41 AM
#2
This is strange, that's exactly the code the wizard creates. Try adding the part about docking, maybe the bar isn't displayed otherwise.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 4th, 2002, 09:47 AM
#3
Thread Starter
Lively Member
not when I create a dialog based application.
-
Dec 4th, 2002, 09:48 AM
#4
Or try adding a call to CFrameWnd::ShowControlBar
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 4th, 2002, 09:54 AM
#5
It's dialog based? That makes it more complicated. MFC is more a hindrance than a help when you're trying to do things that were not planned.
Try using CToolBarCtrl instead of CToolBar
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|