mfc extension library - cj60lib ( updated for visual c++ 6.0 )
The original library (mfcxlib) was renamed to cj60lib, in order to break any links that may have been established with any applications using the old library, and to establish a version control system. the library has the same functioinality as the old one, however, there have been several enhancements for compatibility with visual c++ 6.0.
follow these steps to setup your application to use cj60lib mfc extension library:
- in your project settings, select the general tab. make sure that microsoft foundation class is set to use mfc in a shared dll.
- in your project settings, select the link tab. set the category to input, and add ../lib to additional library path.
- while still in the link tab, change category to general. for output name (all configurations), build to the ../lib directory. this makes the execution and debugging easier, since both dll and exe are located in the same directory. an example of this would be: ../lib/mydemo.exe.
- select the c/c++ tab next. change category to preprocessor, and add ../include to additional include directories.
- the last step would be to add the following two lines of code to your stdafx.h header file, which will import all exported classes, and grant access to your entire application:
#define mfcx_proj #include <cj60lib.h>
in order to statically link to cj60lib, make the following changes:
- in your project settings, select the general tab. make sure that microsoft foundation class is set to use mfc in a static library.
- add the following additional line of code to your stdafx.h header file, which will cause the library to link statically with your application ( make sure you do this prior to the include statement ):
#define mfcxlib_static #define mfcx_proj #include <cj60lib.h>
this library was written for version 4.71 or later of comctl32.dll. if you have an older version, you can download the latest version from the microsoft site.
classes found in cj60lib:
ccjbutton - ( cjbutton.cpp and cjbutton.h )
i wrote this class the originally handle the minimize and close buttons found in the ccjcontrolbar class. this class handles flat style buttons. i have expanded upon this and created an article which implements the static button control as seen in the project settings->custom build tab in visualstudio.
ccjcombobox - ( cjcombobox.cpp and cjcombobox.h )
i wrote this class to handle the flat looking combo boxes as seen in the microsoft office products. its easy to use, simply replace any occurance of ccombobox, with ccjcombobox.
ccjcontrolbar - ( cjcontrolbar.cpp and cjcontrolbar.h )
this class is based upon the csizingcontrolbar class written by cristiposea. i added a more authentic look to the control, including a minimize and maximize button, grippers button tooltips, popup menu support, and verticle and horizontal sizebar cursors.
ccjframewnd - ( cjframewnd.cpp and cjframewnd.h )
ccjmdiframewnd - ( cjmdiframewnd.cpp and cjmdiframewnd.h )
ccjdockbar - ( cjdockbar.cpp and cjdockbar.h )
these classes override the default main frame layout to allow an offset for the 3d look added to the toolbars. to use these classes, simply change cframewnd to ccjframewnd where cmainframe is derived from in the mainfrm.h file (use ccjmdiframewnd for mdi applications).
ccjoutlookbar - ( cjoutlookbar.cpp and cjoutlookbar.h )
this class has changed quite a bit since the last release for vc5. i have added message handlers for mouse events, and modified it to use the ccjpagerctrl class, instead of the default list box scroll bars.
ccjpagerctrl - ( cjpagerctrl.cpp and cjpagerctrl.h )
this class wraps the pager common control. to use it simple create it within your view or dialog box, and set the child window with the hwnd of the control you wish pagged. when creating the child window, set the pager as its parent.
ccjtabctrlbar - ( cjtabctrlbar.cpp and cjtabctrlbar.h )
this class is based upon dirk clemens article sizing tabcontrolbar. i have made some enhancements to the code to accomindate the modifications i made to the ccjcontrolbar class, which this class inherits from.
ccjtoolbar - ( cjtoolbar.cpp and cjtoolbar.h )
i wrote this class to extend the ctoolbar class. this class adds a gripper to the toolbar, sets the font the toolbar will use, draws the 3d borders for the look and feel of the visual studio and office products. additionally i have add a method which allows controls to be added to the toolbar such as combo and edit boxes. to use this toolbar class, simply change ctoolbar to ccjtoolbar.
ccoolmenumanager -( coolmenu.cpp, emboss.cpp and coolmenu.h )
csubclasswnd -( subclass.cpp and subclass.h )
this code was written by paul dilascia. check out the january 98' issue of msj. it is probably the easiest implementation for cool menus ( pulldown menus with icons ) that i have seen. some minor enhancements have been made to fix memory leak problems. these classes have been integrated into the xframewnd extensions. in order to use cool menus, simply add the following code to your cmainframe::oncreate method:
cflattoolbar - ( flatbar.cpp and flatbar.h ) obsolete with vc 6.0
cmoduleversion - ( modulver.cpp and modulver.h )
this is the base class that my ccjtoolbar derives from. this class was written by paul dilascia, and handles most of the sizing and internal issues with flat toolbars. cmoduleversion is used to check the current version of the common control dll. cflattoolbar is a composite of the october 97 and august 98 issuses of microsoft journal.
ccoolbar, crebarinfo - ( coolbar.cpp and coolbar.h ) obsolete with vc 6.0
this code was originally written by paul dilascia. i have made some enhancements to the original code, these are the classes that are used to create the rebar bands as seen in the internet explorer 4 style ui article int the advanced ui section.
chyperlink - ( hyperlink.cpp and hyperlink.h )
this class was written by chris maunder, from his article hyperlink control. i am using this class in order to add hyperlinks to the about dialogs in most of my articles. i have made on minor change to this class which changes the "gotourl" method from protected to public. this allows the routine to be called directly, without having to go through a static object.
this code may be used in compiled form in any way you desire. this file may be redistributed unmodified by any means providing it is not sold for profit without the authors written consent, and providing that this notice and the authors name and all copyright notices remains intact. if the source code in this file is used in any commercial application then a statement along the lines of "portions copyright © 1998 kirk stowell" must be included in the startup banner, "about" box or printed documentation. an email letting me know that you are using it would be nice as well. that's not much to ask considering the amount of work that went into this. this software is provided "as is" without express or implied warranty. use it at your own risk! |
acknowledgements:
this would not have been possible without the following authors making their code freely available:
- cristi posea - for writing such a cool csizingcontrolbar class.
- joerg koenig - for some ideas i got for the 3d borders and using controls in toolbars from his cool ctoolbarex class.
- shekar narayanan - for his cool looking menu which inspired me to write the ccjoutlookbar control.
- dirk clemens - for his sizing tabcontrolbar class which i based ccjtabctrlbar on.
- paul dilascia - for all of his great work at msj, and making his source code availiable to us.
- chris maunder - for use of his chyperlink control, and for letting me use his disclaimers.
- zafir anjum - for putting together such an excellent site (www.codeguru.com), and making all those cool mfc resources availiable.
- and to the rest of you for not letting me rest until i updated this library for vc6. i appreciate all of the suggestions and email.
download library and source - 92 kb