This may not be the answer you're looking for, but you might refer to the MFC source code (available with VC++) for an example of how this kind of encapsulation works. If you're unaware, MFC is a C++ ...