The run-time object uses and implements a slightly different set of interfaces, depending on whether it presents a visual user interface.
Like a visual designer, a visual run-time object must provide in-place activation capabilities and a visible user interface, which typically handles events.
Unlike a visual designer, a run-time object that does not present a visual interface doesn't need in-place activation, although it might handle events. To mark itself as invisible, the object uses the IOleObject interface to set the OLEMISC_INVISIBLEATRUNTIME flag. This information appears in the registry entry for the run-time object.
The following table summarizes the functions of the run-time object and the corresponding interfaces:
Function | What you must do |
Be an embedded object (required).
Register itself (required). |
Implement IOleObject.
Implement DllRegisterServer. |
Register custom information for created objects (optional). | Implement DllRegisterDesigner and DllUnregisterDesigner. |
Create instances (required). | Implement IClassFactory or IClassFactory2. |
Invoke properties and methods (required). | Implement IDispatch. Most designers also support VTBL interfaces. |
Provide a visual interface (optional). | Implement IOleInPlaceObject and IOleInPlaceActiveObject. |
Supply type information (required). | Implement IProvideClassInfo or IProvideDynamicClassInfo. |
Load persistent data (required). | Implement IPersistStorage, IPersistStream, or IPersistStreamInit. |
Handle events (optional). | Implement IConnectionPointContainer and IConnectionPoint. |
Delay connecting event sources and sinks (optional). | Implement IActiveDesignerRuntime. Use IActiveDesignerRuntimeSite. |