The Ultimate Toolbox FAQ






4.38/5 (4 votes)
A selection of frequently asked questions submitted by users of the Ultimate Toolbox
- Download the Ultimate Toolbox source code - 3 MB
- Download the Ultimate Toolbox sample projects - 5.4 MB
- Download the Ultimate Toolbox documentation in compiled HTML help (CHM) format - 4.9 MB
Visit the Ultimate Toolbox main page for an overview and configuration guide to the Ultimate Toolbox library.
Contents
Introduction
We've placed some answers here to a few of the most common questions folks have asked about when using various aspects of the Ultimate Toolbox.
If you've come across an issue with the Ultimate Toolbox that needed a work-around or a bit of documentation that didn't quite explain all the ins and outs of a particular function call, please feel free to submit it for inclusion — you can be pretty sure it will be of help to someone else out there!
Note: Some of the answers below will refer to sample projects included in the download above — these are not part of the main sample download for the toolbox, and should be unzipped to the same directory as the main downloads, creating a Faq subdirectory in the main Ultimate Toolbox dir.
Frequently Asked Questions
- Why does my docking dialog dock below the status bar?
- Can I use COX3DtabViewContainer in a dialog based app?
- Using controls (custom buttons) inside of COXCoolToolBar.
- Cool controls in a dialog bar.
- Creating a splitter window inside COX3DTabViewContainer.
- Simulating Delphi environment.
- Selecting and deselecting items in COXShortcutBar.
- Using Customize Manager in an SDI application.
- Including additional RC files.
- Using COX3DTabViewContainer in an MDI app.
- Using COX3DTabViewContainer in a splitter pane.
- Using COXTreeCtrl in a splitter pane.
- Using a RichEdit control in a COXTabViewContainer.
- Using COXToolTipCtrl in a view.
Why does my docking dialog dock below the status bar? (09/19/2000)
Q: When my docking dialog is docked to the bottom of my MDI application the status bar appears to be above. What is going on?
A: To make the status bar appear at the bottom you need to create status bar right after creating the CMainFrame
and before all other child windows like dialog bars etc... The reason for this is because the MFC function CWnd::RepositionBars()
iterates through all child windows to adjust their position and starts from the first child. So, the status bar has to be first child.
Can I use COX3DtabViewContainer in dialog based app? (07/24/2003)
Q: Is it possible to use the COX3DTabViewContainer in a dialog based app?
A: Yes — have a look at the Faq\3DDlgTab sample in the download.

Using controls (custom buttons) inside of COXCoolToolBar. (09/28/2000)
Q: How do I insert a control in a toolbar, particularly in COXCoolToolBar
?
A: These are the steps required:
class CMainFrame : public CFrameWnd
{
....
COXCustomTBButtonWnd m_editCB;
....
}
CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// after creating the toolbar add these lines
int nWidth=80; //width of the edit box
//try to insert our edit box in global array of custom buttons
nIndex=m_wndToolBar.AddCustomButton(&m_editCB, IDC_CBEDIT, nWidth);
if(nIndex==-1)
return -1;
nPosition=2; //position in the toolbar desired
//you can do it this way for edit box
VERIFY(m_wndToolBar.InsertEditBox(nPosition, nIndex));
//or this way for any control, but make sure to specify fourth parameter - class name
VERIFY(m_wndToolBar.InsertCustomButton(nPosition,nIndex,WS_CHILD |
WS_VISIBLE,0,_T("Edit")));
....
See also the Faq\CustomButtons sample in the UltimateToolboxFaq_samples download accompanying this article.
Cool controls in a dialog bar. (11/27/2000)
Q: How do I use cool controls in a dialog bar?
A: It is similar to using cool controls in a dialog, but with some exceptions.
Steps to include cool controls in a dialog bar:
- Create template for the dialog bar in the resource editor.
- On this dialog bar place the common controls you want.
- Go to Class Wizard and derive your own class from
CDialogBar
. - Add variables for controls you've placed on dialog bar template. Example: if you want a cool edit:
class CMyDialogBar : public CDialogBar
{
....
COXCoolCtrl m_edit;
....
}
- Add virtual function
DoDataExchange()
and code the body of the function:
void CMyDialogBar::DoDataExchange(CDataExchange* pDX)
{
CDialogBar::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT, m_edit);
}
- Copy the declaration of the
CDialogBar::Create()
function and write in the body of the function:
BOOL CMyDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
{
if (!CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID))
return FALSE;
// call DoDataExchange() when subclassing the cool controls
UpdateData(FALSE);
return TRUE;
}
- Common steps for any dialog bar:
Include a variable of the
CMyDialogBar
type inCMainFrame
(for SDI/MDI projects) and call create in theOnCreate()
handler forCMainFrame
.NOTE: To use buttons as cool controls don't forget to define a handler for these buttons in order to enable the button! See article Q98198 in the MS KB "CDialogBar Button Enabled When Command Handler Present"
See also the Faq\CoolDlgBar sample in the UltimateToolboxFaq_samples download accompanying this article.
Creating splitter window inside COX3DTabViewContainer. (07/20/2000)
Q. I want to create a splitter window inside COX3DTabViewContainer. How can I do it?
A: Declare the two variables - CSplitterWnd
and COX3DTabViewContainer
- in your CView
derived class. In the views OnCreate()
function create the COX3DTabViewContainer
, then the CSplitterWnd
, then create the panes of the splitter, and finally add the splitter to the pages of the COX3DTabViewContainer
.
See also the Faq\SplitInTab sample in the faq samples download.

Simulating Delphi environment. (06/19/2000)
Q. I want to create application that has many separated child windows and no main owner window (looks like Delphi environment). How can I do It?
A: You can do this by creating all child dialog windows with CDialog::CreateIndirect()
function.
We've provided a sample in the faq samples download in the Faq\DelphiLikeApp directory.
Selecting and deselecting items in COXShortcutBar. (06/02/2000)
Q. I have 3 groups in the COXShortcutBar
. And when one item is selected in one group I want the selected items in the other groups to be unselected. What function should I use to accomplish that?
A: To do that you have to clear the selections in all inactive groups, add the following function to your COXShortcutBar
derived class and call this function for all these groups when a selection is made:
void SetGroupSel( int group, int selItem = -1 );
void CShortCutBar::SetGroupSel( int group, int selItem )
{
HSHBGROUP hGroup;
hGroup = m_shortcut.FindGroupByOrder(group);
m_shortcut.GetGroupListCtrl(hGroup)->ActivateItem(selItem);
}
Using Customize Manager in SDI application. (06/01/2000)
Q. I want to use Customize Manager in SDI application, but could not get it to work. What's wrong?
A: There are some points to follow to implement COXCustomizeManager
, as described in the help chm. One of the points is that you have to explicitly assign the main app window before initializing the CustomizeManager
pages:
AfxGetApp()->m_pMainWnd=this;
#ifdef OX_CUSTOMIZE_TOOLBARS
VERIFY(m_customizeManager.InitializeToolbars());
#endif //OX_CUSTOMIZE_TOOLBARS
#ifdef OX_CUSTOMIZE_COMMANDS
VERIFY(m_customizeManager.InitializeCommands());
#endif //OX_CUSTOMIZE_COMMANDS
The Faq\CustMngrSdi project demonstrates this.
Including additional RC files. (05/07/2002)
Q. How can I include the resources (*.rc file) if I have one included already?
A: For VC6, to include a resource file, for example, utsampleabout.rc , go to View->Resource Includes.. and enter it in the dialog box as shown:

For VS2005, you can right click on an existing .rc file in the resource view and select Resource Includes...
COX3DTabViewContainer in MDI app. (06/20/2000)
Q. How can I create COX3DTabViewContainer like a page of another COXTabViewContainer in an MDI application?
A: We've wrapped up a sample of how to do this in the Faq\3DTabIn3DTab dir of the faq samples download.

COX3DTabViewContainer in splitter pane. (06/12/2000)
Q. How can I create COX3DTabViewContainer or COXTabViewContainer in a pane with splitter?
A: You have to derive your own class from COX3DTabViewContainer
and provide dynamic creation capabilities (using macro IMPLEMENT_DYNCREATE
and DECLARE_DYNCREATE
). COXTabViewContainer
does not require you to override it, but you may want to do it. Then, create the panes in the usual way.
See also the Faq\TabsInPane\TabProblem sample to see how this is done.

COXTreeCtrl in splitter pane. (06/02/2000)
Q. How can I create COXTreeCtrl
in a pane of the view with a splitter?
A: The idea is to create the pane with the view as usual and make COXTreeCtrl
member of this view. Once the view has been created — create COXTreeCtrl
object. In addition we need to handle WM_SIZE
message to change the size of the tree.
See the sample project in the Faq\TreeInPane dir for more details.
RichEdit control in COXTabViewContainer. (06/02/2000)
Q. How can I create RichEdit control pages in COXTabViewContainer
?
A: We've included a sample that shows how this can be done. Don't forget to call AfxInitRichEdit()
before starting to work with rich edit control.
The sample project in the Faq\RichInTab dir shows this in action.
Using COXToolTipCtrl in a view. (06/02/2000)
Q. How can I attach your COXToolTipCtrl
to a view. I have created an MFC CToolTipCtrl
and it worked. After replacing CToolTipCtrl
with COXToolTipCtrl
it did not work. How should I use COXToolTipCtrl
?
A: COXTolTipCtrl
needs to be attached to the main application window. You have to provide a handler for RelayEvent()
in the PreTranslateMessage()
virtual function of your main class. The tool may be a window or rectangle of a window.
See the sample in the Faq\ToolTipInView directory for a working implementation.
History
Initial CodeProject release October 2007.