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
-
Initialize OLE.
-
Register the class factories of the exposed objects.
-
Register the active object.
To implement exposed objects
-
Implement the IUnknown, IDispatch, and virtual function table (VTBL) interfaces for the objects.
-
Implement the properties and methods of the objects.
To release OLE when the application terminates
-
Revoke the registration of the class factories and revoke the active object.
-
Uninitialize OLE.
To retrieve active objects for use by others
-
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.
-
Create a registration (.reg) file for the application.