Exposing Objects

To expose ActiveX objects, you write code to initialize the objects, implement the objects, and then release OLE when the application terminates.

    To initialize exposed objects
  1. Initialize OLE.
  2. Register the class factories of the exposed objects.
  3. Register the active object.
    To implement exposed objects
  1. Implement the IUnknown, IDispatch, and virtual function table (VTBL) interfaces for the objects.
  2. Implement the properties and methods of the objects.
    To release OLE when the application terminates
  1. Revoke the registration of the class factories and revoke the active object.
  2. Uninitialize OLE.
    To retrieve active objects for use by others
  1. Use the Object Description Language (ODL) to create an .odl file, or use the Interface Definition Language (IDL) to create a library section in an .idl file that describes the properties and methods of the exposed objects. Use the MkTypLib utility to compile the .odl file into a type library or use the Microsoft Interface Definition Language (MIDL) compiler for both the .idl file and .odl file.
  2. Create a registration (.reg) file for the application.