![]() |
Adding Run-Time Type Library Support to MFC OLE Automation ServersOLE Automation servers created with the MFC AppWizard and ClassWizard do not make type library information available at run-time. This is a shame, since the code and data are quite available. This technical tip describes the steps required to add run-time type library support. The Step-by-Step How-ToThis assumes you have already created a DLL or EXE with AppWizard, then created one or more OLE Automation classes derived from CCmdTarget using the ClassWizard. To add run-time type library support, do the following
It is also very helpful to register the type library when the server registers, since many development tools use the statically registered type library information to optimize access to the server classes. In particular, parameter and return value types can be checked at design time, and dual interfaces can be used. (For more information on adding support for dual interfaces to MFC OLE Automation servers, see Visual C++ TN065 Dual-Interface Support for OLE Automation Servers.)
To increase the usefulness of the type library, you might want to add version and helpstring clauses to the interfaces and classes defined in the ODL file.
Copyright © 1996 Scott Nichol. 27-Dec-96 |