The Window Tabs Add-In (WndTabs) is another freeware add-in available from the WndTabs site
(http://www.wndtabs.com).
The WndTabs source code is freely available and includes many useful classes
and utility modules. Line Counter makes use of some of these classes and modules:
Configuration Variables With Automatic Registry Persistence -
The Config.cpp module allows you to easily create configuration
variables for your program. The variables will be saved and retrieved
from the registry using two simple commands: GetConfiguration()
and WriteConfiguration().
All you have to do is define your variables (which can be of either
integer or string types), in a file called CfgVars.h.
In this file use the CFG_VAR and CFG_STR macros to declare
your integer and string variables (respectively). To access the
variables, simply #include Config.h in your source modules,
and thats it!.
HTML Help Made Easy - By using the HTML Help support
module (HHSupp.cpp),
you can easily add HTML Help support to your application and its
dialogs/property pages. The support module will do the
following for you:
Try to load the HTML Help component dynamically. Help won't be
provided if the load fails, but your application will keep on
running without a problem.
Allow you to make calls to HTML Help API.
Easily create dialogs and property sheets with context sensitive
help (that little '?' on the title bar of the dialog). You can
either write a simple, text-only description for your dialog
items, or use a full-blown HTML page. Both are supported by
HTMLHelpBase, and are as simple as adding one
macro to your dialog class.
Easily add help support to menu items and commands (for full MFC
applications.
And more!
NOTE: WndTabs 2.50 uses the older version of the module (HTMLHelpBase) and will
be upgraded to use the new module in the next version.
Property Pages For Setting Program Configuration - AutoPropPage.cpp
defines a base class for a property page that knows all about
configuration variables. Just give it a list of these variables,
and you have extensive support for the functionality of the "OK", "Apply",
and "Cancel" buttons.
In fact, the simple needs of Line Counter require nothing more than
simply subclassing from the provided base class. More hidden power
lies behind the CAutoPropPage methods Changed(), ChangedAny(),
OrigVal(), and PrevVal() which can be seen in action
in the WndTabs sources.
Make sure to take a look at the WndTabs sources to see the features of the
functions described above in further depth and detail!.