custom_registration< CLASS > Class Template Reference
[Server implementation details.]

#include <server.h>

List of all members.

Public Member Functions

void on_register (const TCHAR *)
void on_unregister (const TCHAR *)


Detailed Description

template<typename CLASS>
class custom_registration< CLASS >

Template class for specifying your own custom registration.

The default template does nothing - define a specialization of custom_registration for each Coclass that you wish to have custom registration.

on_register is called after the standard registration. on_unregister is called before the standard unregistration.

Common initialization and cleanup code for both registration and unregistration can be put in the constructor and destructor.

All exceptions thrown by on_unregister are caught and discarded.

Example usage:

        class custom_registration<comet::CoPerson>
        {
                comet::regkey key_;
                public:
                custom_registration<comet::CoPerson>()
                {
                        key_ = comet::regkey(HKEY_LOCAL_MACHINE).open(_T("Software\\AcmeCorp\\AcmePayroll"));
                };
                void on_register(const TCHAR *filename)
                {
                        key_.create(_T("Bill Bloggs"));
                }
                void on_unregister(const TCHAR *filename)
                {
                        key_.delete_subkey(_T("Bill Bloggs"));
                }
        };


The documentation for this class was generated from the following file: