Type Information for ActiveX Designers

ActiveX designers can support either static or dynamic type information. Static type information remains the same throughout the object's lifetime. Dynamic type information 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, can change the type information for the designer.

Dynamic type information and type libraries allow you to 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.

The IProvideClassInfo interface provides static type information; the IProvideDynamicClassInfo interface provides dynamic type information.

When you create an ActiveX designer, you should consider at the outset which kind of type information to support. If the type information can never change, support static type information. For example, if your ActiveX designer can only be built into other objects and does not allow an end user to attach code that would alter the type information, you can implement IProvideClassInfo.

If the type information can change, you have to support dynamic type information. For example, if you expect end users to add event procedures or controls to your ActiveX designer, implement IProvideDynamicClassInfo.

The visual designer and the run-time object must implement the same type information interface.

Although Visual Basic 5.0 can use either IProvideClassInfo or IProvideDynamicClassInfo, older hosts may support only IProvideClassInfo. If you expect your ActiveX designer to be used with hosts other than Visual Basic 5.0, you should support both interfaces.

For details on the type information interfaces, see Chapter 9, "API Reference," and the  Automation Programmer's Reference.