|
-
June 10th, 1999, 03:13 PM
#1
Making Toolbar settings persistent
I have two toolbars and I am trying to make them persistent. I am using SaveBarState and LoadBarState. I call the LoadBarState in the OnCreate function in the MainFrame.cpp file, after I have created the toolbars and statusbars. I also call the savebarstate in the onclose function in the Mainframe.cpp. This doesn't seem to work with two toolbars, however it does work if you only have one toolbar. So, if anyone can help me out on this I would appreciate it.
Thanks,
Angie.
-
June 10th, 1999, 03:25 PM
#2
Re: Making Toolbar settings persistent
Make sure so give each toolbar a unique ID when they are created.
By default, they both get an ID of AFX_IDW_TOOLBAR so their
states won't get saved correctly.
-
June 10th, 1999, 03:39 PM
#3
Re: Making Toolbar settings persistent
The toolbars are created with a unique id. Example: IDR_MAINFRAME
IDR_SYSTEM_TOOLBAR
IDR_TERRAIN_TOOLBAR
I actually have three toolbars. If I only create one then I can save the state of that one but when I create all the results are not create.
-
June 23rd, 1999, 04:58 AM
#4
Re: Making Toolbar settings persistent
Hi,
are you sure, that you give them different IDs ? The IDs must also
different in the Create-Funktion, not only in LoadToolbar. Try this
code, wich I found via www.deja.com.
UINT flags = WS_CHILD | WS_VISIBLE | CBRS_TOP;
if (!m_wndToolBar.Create(this,flags,IDR_MAINFRAME) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // Fehler beim Erzeugen
}
hope that helps
Achim
[email protected]
-
June 23rd, 1999, 12:49 PM
#5
Re: Making Toolbar settings persistent
Yes, if an id is not passed to the Create call the toolbar id defaults to
AFX_IDW_TOOLBAR
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
|