Type Information for ActiveX Designers

ActiveX designers can support interfaces for either static or dynamic type information. The IProvideClassInfo interface provides static type information, which remains the same throughout the object's lifetime. The IProvideDynamicClassInfo interface provides dynamic type information, which can change while the object is active. ActiveX designers that support dynamic type information change their type information objects and type libraries in response to end user edits. Adding an event, for example, changes the designer's type information.

When you create an ActiveX designer, you should consider at the outset which kind of type information to support. The visual designer and the run-time object must implement the same type information interface. If the type information can never change, the designer can simply support static type information. For example, if your ActiveX designer does not host programmable subobjects like ActiveX controls, and the set of properties, methods, and events of the designer do not change, implement IProvideClassInfo.

If the type information can change, you must support dynamic type information. For example, if you expect end users to add event procedures or controls to your ActiveX designer, you must implement IProvideDynamicClassInfo. Supporting dynamic type information has other benefits. You can share and reuse code, reducing implementation time. And instead of having to create several type libraries, you create only one, preventing potential inconsistencies that could cause problems for end users.

See Chapter 9, "API Reference," and the Automation Programmer's Reference in the Platform Software Development Kit (SDK) for details on type information interfaces.