|
 
Introduction
Welcome!
We are very happy to announce that we have made the decision to offer our commercial lineup of MFC libraries, including Ultimate Toolbox, Ultimate Grid, and Ultimate TCP/IP to The Code Project community free of charge.
These are the full and complete libraries including source code, documentation, samples and examples.
Ultimate Toolbox, Ultimate Grid and Ultimate TCP/IP come with full source code, and are compatible with Microsoft Visual Studio versions 6.0 through 2005.
The Ultimate Toolbox and line of related MFC libraries products have been powering professional MFC applications for more than 10 years. We realize that there is a very large number of users who are still coding new applications in Visual C++ and MFC and who are looking for effective and proven libraries to enhance their applications, as well as those with legacy code to maintain and update.
By releasing these long standing MFC libraries to The Code Project community we hope that the libraries will continue to grow, evolve and provide a library of useful controls to the development community through the auspices of The Code Project and its members.
Contents
The Ultimate Toolbox forms an extensive collection of classes dealing with many aspects of Windows programming. We have organized the samples and documentation into the following categories - each category page lists the main classes available in that group, and some will contain a link to sample accompanying short article. (Note that most of these are short overviews distilled from the existing documentation - for full class references, refer to the compiled HTML help documentation download.)
Extended MFC UI Controls
Controls that we derived from existing MFC controls and improved upon. These include components such as:
- Office 2003-like and Office XP-like look and feel
- Shortcut bars.
- Extended combo boxes.
- Extended tree controls, including an option tree.
- Masked edit controls - generic and specialized
Classes Extending the MFC UI Framework
These classes expand upon the document-view framework, and provide enhanced functionality such as:
- Customization classes that let your users customize the UI of your application (e.g. the creation/modification of toolbars, menus, etc.).
- Cool tool bar classes, letting you easily add controls to your toolbars (drop lists, check boxes, edit controls, etc.).
- Cool menus, like cool toolbars, allow you to quickly provide advanced functionality to your menus (e.g. display icons/bitmaps).
- Docking windows classes that give your docking windows the functionality and feel of Microsoft applications (e.g. Office 2000).
- Tab view classes that let you display tab views using a wide variety of styles, such as Hot Track, Multi-line and Positioned (left, right, etc.) tabs.
Utility and Shell Extension Classes
These classes can enhance your applications by letting you retrieve system information, implement trace/debugging features, use sound effects, and perform other utility-related operations with ease. Examples of these utility and shell extension classes are:
- A system information class.
- Advanced trace and assert classes.
- Sound effects class.
- XML file parsing class.
- Resource file modification and view classes.
- Data Compression class
- Task bar and Application bar classes.
Graphics Classes

These classes let you display graphics (e.g. BMP, JPEG, etc.) with ease, and the kit also comes with JPEG compression and metafile creation/playback classes. Some examples are:
- JPEG compressor and de-compressor libraries.
- DIB manipulation/conversion classes.
- Metafile classes that come with Ultimate Toolbox provide functionality to load all standard formats of Metafiles (*.wmf, *.emf) from either disk or resource, play back loaded metafiles, and even create new ones.
We've split up the code, samples and documentation of the Ultimate Toolbox into separate ZIP files, to make updates easier.
In general, for a code library such as the Ultimate Toolbox, installation files are a cumbersome nuisance. While they do allow the formality of license agreement acceptance, and are expected of a commercial offering, for our purposes it would be too much trouble to update an entire install in order to accommodate a small update to a core source file or sample - we may in the future provide updates in various formats, from a single class to an entire new distribution as situations warrant. And, of course, the CP community is more than welcome to contribute.
The samples and library projects all reference relative paths with respect to source and include files, and should compile 'out of the box' if the ZIP files are extracted to a common directory - by default, Ultimate Toolbox, which should look more or less like this:
Once the main source and sample distribution is installed, you'll find that most of the samples can be built and run without the need to build any libraries or DLLs. This source code download has been stripped of some of the pre-built libraries that were shipped with previous commercial installations in order to conserve bandwidth - notably the proprietary JPEG libraries, which should be built ( Ultimate Toolbox\lib\JPEG\jpg.dsw ) before building the samples that reference it and the static libraries or DLLs. The jpg VC6 workspace should convert and build without problem with Visual Studio .NET or 2005, and the resulting libraries placed in the Ultimate Toolbox\lib\Libs directory. The static libs and DLL builds in the lib\Build Libs and lib\Build DLLs can then be built.
The static library is handy when using one of the frameworks (docking windows or app customization), but many classes can be easily used directly in your project with the addition of only one or two source and header files - season to taste. For the most part, except for samples that show the use of the DLL or static lib, the samples use the source directly allowing for direct debugging and testing as the need arises.
The CHM DOC file will provide more detailed information on each of the classes and their interfaces, and has an index and full text search - great for 'hmmm... I wonder if there's a class for...' type scientific explorations.
Support for the products will be community based, and will include participation from core developers of the products, long standing and informed users of the products, and other members of the CodeProject.com community.
It is our intention that you be able to use the libraries in any manner you wish, however, specific details of licensing rights, limitation of liability, and other details are included both here, and in a license.txt file included with the downloadable packages
August 2007 - Ultimate Toolbox Version 9.3 forms the initial CodeProject community release.
Version 9.3
New:
- The Hyperbar classes provide an easy way to add some cool UI functionality to any existing or new project that uses a toolbar.
Bug Fixes:
- Missing VS2003 static lib build project files reinstated.
- Vista problems with 'shadow window' rendering addressed.
OXSkins - it's now possible ( and preferred ) to specify the desired skin using an enum
- The
CustomiseManager sample has a minor bug fix, which caused a very rare crash
OutlookStyleDemo : Added ability to change skin type at runtime, and improved overall skin support.
COXBItmapMenu : Fixed bug which caused documents to close when dirty without prompting
COXFrameWndDock::MakeItDockable : Can now specify which sides to support and if we should dock immediately
COXFrameWndDock::AttachMDIChild : Allows users to specify the side to dock to, before it would dock to the first one that was available. Also fixed some docking bugs in this class.
COXListEdit : Added code to send a message to indicate editing has ended when the drop button is pressed.
COXPropertyTree : Added code to send a message to indicate editing has ended when focus is lost.
- Moved all the skinning drawing into seperate classes, so they are all handled polymorphically by the toolbox controls.
COXSizeDockBar::TabAllDockedControlBars : Added code so that the visible bar can be selected, via a pointer or by index.
Version 9.2
Major release feature:
- The entire code base is now compatible with VC++ 2005, VC++ 2003, and VC++ 6. You get zero-warning compilation on VC++ 2005.
Bug Fixes:
COXComboPickerCtrl::OnPaint now checks if the OS version is XP or higher, and if so it uses the default OS painting, else it does custom painting for the combo box arrow
COXCalendarPopup::OnPaint : A bug (missing cast) has been fixed which caused an error in VC++ 7.1 or higher
COXDateTimeCtrl::OnDropDown : The return value has been changed from TRUE to FALSE, thus fixing a bad bug where the parent window never gets to handle the notification.
- The bug in MDI child menus (in skinned mode) where the restore, minimize, and close items were shown in an un-skinned condition has been fixed.
COXSysInfo has been updated to correctly identify all OSes up to Windows Vista.
- The Cool Controls demo had a bug where the Listbox tooltips came up as garbage - this has been fixed.
- Minor bugs have been fixed in the Status Bar demo (which caused garbage to show up in it)
- The Screen Grabber demo has been fixed to not crash on a multiple monitor setup.
- A trivial bug in
COXMDIFrameWndSizeDock::OnActivate has been fixed.
- A bug in
COXTreeCtrl that caused random crashes during drag/drop scenarios has been fixed.
Version 9.0
Major Upgrades:
- The Office 2003 Look and Feel was added. The following Ultimate ToolBox UI elements support this new skin:
- Menus
- Toolbars and menubars
- Docking windows
- MDI tabs and Tear-off tabs
- Shortcut bar
- Properties window
- Status bar
- The Properties window was enhanced to look more like the VS.NET properties window.
Minor Changes and Fixes:
- A bug causing the Caption Painter not to work in Windows XP was fixed.
- A problem casing excessive flashing of the toolbar, menu bar and docking windows under the Office XP skin was fixed.
- A problem causing the close, minimize and maximize buttons of the menu bar to appear too large in skinned Windows XP was fixed.
- A bug causing a floating toolbar to stick to the mouse cursor even after the user has released the button was fixed.
- A GDI leak found in the Office XP skin causing problems in Windows ME was removed.
- Several upgrades to the
COXTreeCtrl were implemented:
- Arrow key navigation was added.
- Various drawing problems involving different back colors were fixed.
- An item indentation problem involving adding a child item to a collapsed parent was fixed.
- A problem in
COXPreviewDialog caused by a font that does not exist in all operating systems was fixed.
- The classes
COXTreeCtrl and COXGridCtrl will draw their sort headers correctly now in Windows XP skinned mode.
- Several upgrades to the
COXPropertiesWnd class were implemented:
OnDeleteProperty() notification was added.
- A method for deleting all properties called
DeleteAll() was added.
- A problem causing a crash if a property is deleted while being edited was fixed.
- A problem causing the combo box drop list not to show in its entirety was fixed.
- Added the following functionality: when editing a property the changes will be accepted if Enter is pressed and discarded when Escape is pressed.
- Fixed a problem in
COXMultiComboBox causing uncontrolled scrolling to the bottom of the drop list in Windows XP skinned mode.
Sample Changes:
- The
SkinsDemo sample was enhanced to show the new Office 2003 look and feel.
- The
SkinsDemo sample was upgraded to demonstrate how to show and hide the different docking windows from the View menu.
New Classes:
COXUxTheme – internal class used by various Ultimate Toolbox classes designed to detect the presence of Windows XP skins and retrieve their color schemas.
Version 8.1
Major Upgrades:
- Visual Studio.NET 2003 full compatibility.
- Enhancements to the VS.NET like properties window: the following property types with their appropriate editors are now supported:
- Text
- Numeric (with the ability to specify the number of decimal places)
- List of items (enumeration)
- Date
- IP address
- Currency
- Color
- Filename
- Directory
- Time (from nanoseconds to days)
- Angle (degrees, radians or grades)
- Length (metric or imperial)
- Temperature (Celsius, Fahrenheit, Kelvin)
- Custom field with a custom editor.
Minor Changes and Fixes:
- The
TVOXS_NOFOCUSRECT style was introduced in COXTreeView to provide the ability to turn off the item focus rectangle for selected items.
- A buggy assertion statement was removed from
COXMDIChildWndSizeDock::Create(…)
- An auto-scrolling problem in
COXMultiComboBox was fixed.
- A bug in
COXPhysicalEdit causing a crash was fixed.
- A bug causing all drop edit controls to show garbage characters in the tooltips was fixed.
- A bug preventing
COXTreeCtrl::SelectItem(…) from having any effect in single selection mode was fixed.
- A bug causing a floating menu to jump away from the mouse cursor was fixed.
Sample Changes:
- The
SkinsDemo sample was enhanced to demonstrate the use of COXPropertiesWnd and all the different type of properties that are supported.
- The
CustomizeManager sample was modified to reflect that in CMainFrame::OnCreate() InitializeToolbars() must be called prior to calling InitializeCommands().
New Classes:
COXPropertyTree – internal class used by COXPropertiesWnd.
COXListEdit – A drop edit control with the ability to display a list of items.
COXListPopup – internal class used by COXListEdit.
COXIPEdit – A an IP address edit control.
COXCalendarEdit – A drop edit control for dates.
COXMonthCalPopup – internal class used by COXCalendarEdit.
Version 8.02
Changes and Fixes:
- When the snapping and tear-off behavior is enabled a floating window could not be resized. This was fixed.
- OXShdWnd.cpp was not added to the build library project causing link errors. This was fixed.
- In
COXPropertiesWnd it was possible to edit a category name, which caused a crash. This was fixed.
- When the extended tree control (
COXTreeCtrl) is automatically populated the user could not expand the tree by single clicking on the plus. This was fixed.
- Some painting problems of the edit control of the extended tree were fixed.
- A problem preventing a date item from being edited in the extended tree was fixed.
- The
COXShdWnd class was not declared as exportable, which caused some link errors. This problem was fixed.
- In the Customize Manager it was possible to turn off the "cool look" of the toolbars while in OfficeXP skin mode, which caused a crash. This problem was fixed.
- A paining problem of
COXCustomTBComboBox with the CBS_DROPLIST style under the Office XP skin was fixed.
- A problem causing
COXSkinnedCombo not to send CBN_SELCHANGE message was fixed.
- A problem causing a floating window not to redraw the window behind it fast enough while moving was fixed.
- In
COXDao the FindNext method will work properly with searches on string values.
Sample Changes:
- A new sample called
CustomizeManager was added to the samples/advanced/ directory. This sample demonstrates how to use COXCustomizeManager. The different steps required are written as comments in the source code. Just search for the string "STEP".
- A new sample called
ExtendedTreeControl was added to the samples/gui/ directory. This sample shows how to achieve the functionality of COXTreeCtrl demonstrated in the downloadable Demo Browser.
- The link errors in the TabViews sample were fixed.
Version 8.01
New Functionality:
- Ability to programmatically tab all docked windows on a dock bar. Use
COXSizeDockBar:: TabAllDockedControlBars(…) to accomplish this.
Changes and Fixes:
COXSkinnedComboBox now sends proper notification messages.
- A combo box custom toolbar button is now properly centered in the Windows XP skin.
- A behavior problem was fixed when the user double-clicks the gripper of a tabbed docking window.
- A behavior problem was fixed preventing the user from moving a docked toolbar to the left edge of the windows without the toolbar going into float mode.
- A crash in
COXPreviewDialog which only occurred in Windows 2000 when compiled with VC7 was fixed.
- Missing files causing links errors were added to the SideBySideToolbars sample.
| You must Sign In to use this message board. |
|
| | Msgs 1 to 25 of 300 (Total in Forum: 300) (Refresh) | FirstPrevNext |
|
|
 |
|
|
 |
|
|
First of thank you for making this open source! The ultimate toolbox is a great API and a great learning tool .
Why was the Serial API removed from the 9.3 release? 
It is still referenced in the help file.
Anyways thank you for this
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Gipico
You'll find the serial files in the Ultimate Toolbox/archive/include and /source dirs, and there is a Serial sample in the archive/samples dir.
The archive files are bundled with the samples download.
They may need some tweaking for the latest compilers - for now, provided 'as is'.
Cheers
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hallo,
i try to use a dropedit with calculator. Every thing works fine except keyboard input. I can use mouse but no numbers from keyboard. The only difference is that i use not a CDialog base class but a CFormView derived class. The TAB-key works. Any idea?
Thanks,
Steffen
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
HI Steffen
I ran a small test with a COXCalculatorEdit on an SDI form view, and it works fine.
I'm not sure I understand how you have things set up - more info?
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello,
I want to use the skinning classes with right to left layout (RTL) for Arabic.
Basically it works. And it works even fine when I think it was probably never tested with RTL layout before. But nevertheless, there are some issues which do not allow to use the classes immediately.
Primarily, I noted following issues:
- Menu Bar: The menu bar does not start immediately on the right side. There is an offset and unpainted area. It looks like, that the unpainted area has something to do with the minimize/restore/close buttons for the MDI child windows. There are some painting issues for these buttons too and the cursor position is not correctly recognized if I move over the buttons or if I want to click on them. (I already checked the code a bit. Some problems here seem to be localized in the surrounding of the COXMenuBar::CalcButtonRects() and COXMenuBar::BookSpace() functions. Some other problems might be caused by the used ScreenToClient() calls in the code. As they do not work in mirroring situations, Microsoft recommends to use MapWindowPoints() instead).
- There is also an unpainted area (a small offset) on the left side of each toolbar. And the gripper on the right side is painted over. Also, I cannot use the gripper to move the menu bar.
- If I open a menu from the menubar, it has an offset (too far to the left). And the menu shadow on the left seems to take the background from the right side of the menu.
I'm using following code fragments (in combination with VC6.0) to set the RTL layout in the SkinsDemo Sample Application:
// some definitions (at least needed for VC6.0): typedef BOOL (CALLBACK* FKTN_SETPROCESSDEFAULTLAYOUT)(DWORD); #define LAYOUT_RTL 0x00000001 // Right to left // // This code fragment is located at the beginning of // CSkinsDemoApp::InitInstance() to switch to RTL: // HINSTANCE hInstUser32 = ::GetModuleHandle(_T("USER32.DLL")); if (hInstUser32) { FKTN_SETPROCESSDEFAULTLAYOUT pfnSetLayout; pfnSetLayout = (FKTN_SETPROCESSDEFAULTLAYOUT) GetProcAddress(hInstUser32, "SetProcessDefaultLayout"); BOOL bSuccess = FALSE; if (pfnSetLayout != NULL) bSuccess =(* pfnSetLayout)(LAYOUT_RTL); } Maybe, anybody has already done some fixes or has some experience with using the classes for RTL. Any help would be greatly appreciated. Thank you for your answers in advance. Kind Regards, Michael
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi Michael
Firstly, no, I'm not experienced in this - don't know if other's have modified things, but thought I'd throw in my 2c since you seem to have done your homework on this one.
This looks sooo almost doable... 
Michael 203825 wrote: - Menu Bar: The menu bar does not start immediately on the right side. There is an offset and unpainted area. It looks like, that the unpainted area has something to do with the minimize/restore/close buttons for the MDI child windows. There are some painting issues for these buttons too and the cursor position is not correctly recognized if I move over the buttons or if I want to click on them. (I already checked the code a bit. Some problems here seem to be localized in the surrounding of the COXMenuBar::CalcButtonRects() and COXMenuBar::BookSpace() functions. Some other problems might be caused by the used ScreenToClient() calls in the code. As they do not work in mirroring situations, Microsoft recommends to use MapWindowPoints() instead).
Yes, good call on the min/max/close buttons. You can even watch them repaint in hot mode when the mouse is over the white space on the other side of the window.
Michael 203825 wrote: - There is also an unpainted area (a small offset) on the left side of each toolbar. And the gripper on the right side is painted over. Also, I cannot use the gripper to move the menu bar.
Yes - and I notice that dragging the unpainted space is functional, so this may not be a biggie - gripper just being painted wrong side.
Michael 203825 wrote - If I open a menu from the menubar, it has an offset (too far to the left). And the menu shadow on the left seems to take the background from the right side of the menu.
Yes, the rect for the menu needs to be adjusted to start at the right of the parent item - positioning varies at the moment, but wrong anchor point.
And you're right about the shadow - that code is working from a blit of a screen DC - there would need to be some code to determine the current layout. Maybe a flip could be done in the RTL case before the shadow is set up.
I agree with your call on MapWindowPoints.
I'm not exactly the guy you want to hear from though - the guy you want to hear from is the one who's tried it and found the part that's just impossible to implement.
Just my 2c - I'm finding it tough to determine what the scope will turn out to be.
There must be some others who have looked at this - hope they join in - meanwhile, are you thinking of making some changes yourself?
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello Tim,
thanks for your response!
So far it helped me at least, to confirm my assumptions about the localization of the issues. Maybe somebody else will still join the discussion. If not, I guess I will try to do the changes for myself.
Regards, Michael
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Ok - please track your changes and keep us in the loop. I'm sure you'll be able to get some help on the snaggy stuff. Maybe I can take a look at the shadowing routines.
This could make a nice addition for a future update.
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I've placed a second update here[^].
I've tried to collate all the VS2008 compilation requirements folks have been reporting in this update. Some of you will already have these in place. There may be one extra fix for those running on both XP and Vista, as described in the change history.
And, no, this is not the Vista update, and I should add that this was not tested on Vista, just VS2008 with no service pack and no Feature Pack on XP SP2.
One item worth mentioning is that there may be some subtle changes in the docking window functionality - either with the move to MFC 8.0 or some slight change in the compiler. Please test carefully in this area when moving to VS2008 - more investigation needed here.
Thanks for all the comments and fixes,
Cheers
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hello,
i have some Problems COXRegistryItem under Vista, if i compile my project i got at runtime the following error:
COXRegistryItem::GetStringValue (\CurrentUser\Software\DataPro\): Failed (2147942402 == 0x80070002, Code : 2) : Das System kann die angegebene Datei nicht finden. (means: File not found)
COXRegistryItem::Close (\CurrentUser\Software\DataPro\DataPro\): Failed (2147942405 == 0x80070005, Code : 5) : Zugriff verweigert (means: Access denied)
I use Visual Studio 2005...
how i fix the problem?
Thanks... ^^
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hello,
I am trying to build the Ultimate Toolbox in a VS 2008 project. I fixed all the compiler related issues as mentioned in other posts (GetMenu etc.). Now my project compiles fine. But I am getting the following linker errors: ======== 1>CVTRES : fatal error CVT1100: duplicate resource. type:STRING, name:1659, language:0x0409 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt ======== MSDN says that some string resource must be using a duplicate ID. I have looked at the string tables in all .rc files (there are a total of 39 .rc files in the Ultimate Toolbox package and 1 .rc file of my own) but can't identify any resource with duplicate ID. Has anyone else been able to successfully build it on VS 2008 platform? I believe that you should run into this problem even on VS 2005.
Any help would be greatly appreciated. Thanks in advance.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi
This sounds a lot like the problem discussed here[^], though that seems to be a VS2003 issue.
If the UT samples/library builds are ok, I'd suggest another check of your apps string table, and a look at resource.h to see if there are any odd defines.
Also, are you compiling on a machine with non-western regional settings, and has this project undergone conversion or was it created with VS2008?
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thanks for the response. I was actually able to diagnose the problem. Here it is:
The file OXMain.rc is a dummy resource file in the sense that it doesn't contain resources of its own and instead includes all the other .rc files in the package. I didn't know that and was including all the .rc files in the build. As a result, they were being included twice resulting in a duplicate resource linker error.
In order to fix it, I simply removed all .rc files but OXMain.rc and now it works fine.
Needless to say, it's a great package and thanks a bunch for that.
As an aside, does anyone know if the other Dundas tools from the past like HyperRichText C++ library are also available for newer development platforms?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
riteshjain wrote: As an aside, does anyone know if the other Dundas tools from the past like HyperRichText C++ library are also available for newer development platforms?
Sorry, but all of the "Hyper" technology products were discontinued and have not been released under a shared type license.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Kudos to Code Project and the authors and contributors to Ultimate Toolbox for this great contribution to the community!
Wondering if anyone else has run into this, I searched and browsed the messages for this article and did not find any reference to this.
I have an older Visual C++ 6.0 / MFC application that I "skinned" successfully with the exception of toolbar handling. The application has a call to LoadBarState( _T("ToolBar") )in the CMainFrame OnCreate which is placed after the toolbars are created, and a call to SaveBarState(_T("ToolBar")) in the OnClose. I discovered that the first time the app runs, it is OK, but when it saves the toolbar state it adds another toolbar for a total of 11 instead of 10 (in the pre-skinning INI file), with an ID of 59408. When restarting the application, this newly added toolbar value causes LoadBarState to assert and then crash in CFrameWnd::SetDockState, ASSERT(pInfo->m_pBar != NULL) on this toolbar id.
After much fruitless debugging of my application, as a test I took the Ultimate Toolbox sample application SkinsDemo and simply added a LoadBarState into the CMainFrame::OnCreate and a SaveBarState into the OnClose. On starting up the application for the second time, after the toolbar state has been saved, I get the same exact assertion failure and crash.
Any ideas? I am suspecting the docking mechanisms or toolbar handling or menu handling mechanisms creating a toolbar on the fly and not destroying it before the SaveBarState is called...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Managed to reproduce - using the VisualStudioLikeDemo. (Didn't try skinsdemo).
The 59408 (0xe810) is the id of the default menu that is set for the frame window in the WM_CREATE handler of COXMenuBarHost<PARENTWND>::WindowProc.
Defined in OXMenuBar.h as
// default ID for menubar #define AFX_IDW_MENUBAR 0xE810
On checking the registry (HKEY_CURRENT_USER\Software\Ultimate Toolbox Samples\VisualStudioLikeDemo\) I can see that an entry is added for ID 59408.
This is a bit of a nasty one to debug, needing RegEdit open to see what's going on and reset to test. (BTW if you haven't updated to Update 01 you'll probably see some text garbage here - I'd be interested to know your status on that, I'm testing with the updated code).
The COXMenuBarHost<PARENTWND>::WindowProc WM_CREATE code does seem to be creating an extra menu, after storing the main windows menu in m_hDefaultMenu, it calls SetMenu(NULL) then proceeds to create one with the default ID. Maybe something is left in the handle map that's confusing the SaveBarState and/or LoadBarState code? It does seem to leave a handle dangling.
That's as far as I've taken it - thought it might help - I don't see where SaveBarState or LoadBarState could be incrementing the count. It might be that the state.m_arrBarInfo needs to be looked at to see how it's being affected in the creation code.
Nasty - hate to post without a fix, but maybe you can get some clues from this.
Do let me know if you are using Update 01[^].
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thanks for the quick reply! I downloaded the latest update but can't get it to build, errors in OXSkins.cpp from referencing HMONITOR: D:\UltimateToolbox\Ultimate Toolbox\source\OXSkins.cpp(4061) : error C2065: 'HMONITOR' : undeclared identifier I am running Visual C++ 6.0 with SP5 applied. We still use INI files instead of registry for our application, so it makes looking at the original toolbar problem in debug a bit easier. I did search around CodeProject and find an article which verifies the state of toolbar info here: http://www.codeproject.com/KB/toolbars/verifystateinfo.aspx[^] I adapted that code to override LoadBarState to remove any offending toolbarstate entries before calling the standard SetDockState at startup, and that gets me around this issue for now. Thought of posting that code to that article but didn't, I am still a newbie at codeproject, although a longtime lurker, this is my first thread.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Nice one - maybe you could send me that override (tim_at_codeproject.com). It might be worth providing something similar in the framework classes - or, if it's not too long, post it here.
I always wondered why none of the samples ever saved the toolbar positions... 
For the HMONITOR problem, I think you'll be ok if you add the following to your stdafx.h:
#include <multimon.h>
HMONITOR is defined in windef.h if WIN32_WINNT >= 0x0500, and multimon.h will define it for lower versions.
Thanks
Tim
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thanks for the fix for using the latest update with my setup.
Here is the code I adapted. If you have any suggestions for making it better or bug fixes let me know.
void CMainFrame::LoadBarState(LPCTSTR lpszProfileName) { CDockState state; state.LoadState(lpszProfileName);
for (int i = 0; i < state.m_arrBarInfo.GetSize(); i++) { CControlBarInfo* pInfo = (CControlBarInfo*)state.m_arrBarInfo[i];
ASSERT(pInfo != NULL);
int nDockedCount = pInfo->m_arrBarID.GetSize(); if (nDockedCount > 0) { // dockbar
for (int j = 0; j < pInfo->m_arrBarID.GetSize(); j++) { UINT nID = (UINT) pInfo->m_arrBarID[j]; if (nID == 0) continue; // row separator
if (nID > 0xFFFF) nID &= 0xFFFF; // placeholder - get the ID
if (GetControlBar(nID) == NULL) { pInfo->m_arrBarID.RemoveAt(j--); // invalid bar ID, do not load the state } } } if (!pInfo->m_bFloating) // floating dockbars can be created later { if (GetControlBar(pInfo->m_nBarID) == NULL) { state.m_arrBarInfo.RemoveAt(i--); // invalid bar ID, do not load the state } } }
SetDockState(state);
return; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
| | |