Stingray Studio : Objective Toolkit User’s Guide : Chapter 2 Objective Toolkit Quick Start : Using Component Headers to Increase Application Build Performance
Using Component Headers to Increase Application Build Performance
One factor that can significantly affect the build speed of your project is the size of the precompiled header generated for your project. The larger the precompiled header becomes, the slower each source file compiles. Every header file that is included in the precompiled header contributes to its size and increases the time it takes to compile your project.
The standard mechanism for including the Objective Toolkit headers into your project is to insert a single line into stdafx.h:
 
#include “toolkit\secall.h”
Although this makes integrating Objective Toolkit easy, it can also potentially pull every Objective Toolkit header file into your project. This can result in large precompiled headers and long compile times. Each and every source file included in your project is affected even if you only use a single control. Although this increase in build time may be tolerable in small projects, it is unwieldy for a larger project.
One solution is to limit the number of components built into the library with the Objective Toolkit Build Wizard; however, a better solution is to include a number of component-specific header files in place of secall.h. There is a component-specific header file for each component that you can select using the Build Wizard. You can use these headers individually or they can be combined as needed to include only the components that you require.
The Component Headers
The component-specific header files are listed below:
Table 3 – Component Specific Header Files 
Component
Header file
2D/3D tabbed windows
toolkit\ot_tabwnd.h
Bitmapped dialog
toolkit\ot_bitmapdlg.h
Browse edit control
toolkit\ot_browedit.h
Button classes
toolkit\ot_buttons.h
Calculator edit control
toolkit\ot_calculator.h
Calendar control
toolkit\ot_calendar.h
Color listbox control
toolkit\ot_colorlistbox.h
Color well classes
toolkit\ot_colorwell.h
Compressed file class
toolkit\ot_compressfile.h
Currency edit control
toolkit\ot_currency.h
Custom status bar
toolkit\ot_statusbar.h
Customizable toolbar/menubar
toolkit\ot_toolbar.h
Date/time edit control
toolkit\ot_datetime.h
Design patterns framework
toolkit\ot_patterns.h
DIB image support
toolkit\ot_secdib.h
Docking windows
toolkit\ot_dockingwindows.h
Drop edit control
toolkit\ot_dropedit.h
Editable listbox control
toolkit\ot_listboxedit.h
Encrypted file class
toolkit\ot_encryptfile.h
Enhanced ComboBox
toolkit\ot_combobox.h
File system class
toolkit\ot_filesystem.h
Floating Document Interface (FDI)
toolkit\ot_fdi.h
Full Screen View class
toolkit\ot_fullscreenview.h
GIF image support
toolkit\ot_secgif.h
Gradient caption classes
toolkit\ot_gradientcaption.h
JPEG image support
toolkit\ot_secjpeg.h
Keyboard shortcut classes
toolkit\ot_keyshortcut.h
Marquee control
toolkit\ot_marquee.h
Masked edit control
toolkit\ot_maskedit.h
Multiple Top Level Interface (MTI)
toolkit\ot_mti.h
PCX image support
toolkit\ot_secpcx.h
Progress control
toolkit\ot_progress.h
Random number class
toolkit\ot_random.h
Registry class
toolkit\ot_registry.h
Shortcut bar
toolkit\ot_shortcutbar.h
Splash window classes
toolkit\ot_splashwnd.h
Targa image support
toolkit\ot_sectga.h
Thumbnail classes
toolkit\ot_thumbnail.h
TIFF image support
toolkit\ot_sectiff.h
Tray icon class
toolkit\ot_trayicon.h
Tip of the day class
toolkit\ot_tipoftheday.h
Tree control
toolkit\ot_treectrl.h
User tools menu class
toolkit\ot_usertools.h
View classes (pan, zoom)
toolkit\ot_views.h
Workbook Document Interface (WDI)
toolkit\ot_wdi.h
Workspace manager
toolkit\ot_workspacemgr.h
ActiveScript
toolkit\ot_activescript.h
Advanced docking windows
toolkit\ot_advdockingwindows.h
Docking views
toolkit\ot_dockingviews.h
Layout manager
toolkit\ot_layoutmgr.h
MVC architecture
toolkit\ot_mvc.h
 
 
To use the component headers in your project
You can use the component headers in the same way that you use toolkit\secall.h.
1. Using Build Wizard, build the Objective Toolkit library with the required components.
If you are linking to Objective Toolkit as a static library, you do not need to build a special version of the library. You can improve the performance by using the component-specific headers and the default library with all components. If you are linking to Objective Toolkit as a DLL, carefully select the components you build into the library, as this will affect the size of the DLL that you ship.
2. Remove or comment out the line in stdafx.h that includes secall.h. For example:
 
//#include <toolkit\secall.h>
Add one or more of the component headers to stdafx.h, depending on which components your application requires. For example:
 
#include <toolkit\ot_dockingwindows.h> // Docking Windows
#include <toolkit\ot_maskedit.h> // Masked edit control
 
// alternative to above: if you want to include ALL
// Objective Toolkit headers, uncomment the following line to use
// the classic Objective Toolkit inclusion method (will increase
// build time)
//#include <toolkit\secall.h>
3. Build your project. If you experience build errors, there are two likely causes:
*A required component header was not included.
*The library was built with one of the required components missing.
If you are having problems using component headers, revert to using toolkit\secall.h.