The first step associated with implementing a part is positioning the part class in the C++ class hierarchy. Place your nonvisual part under the IStandardNotifier class hierarchy. Inserted in this location, your part inherits certain default behavior from IStandardNotifier and the INotifier protocol.
In some cases, you might want your nonvisual part to be abstract. Be aware that your users cannot drop abstract nonvisual parts onto the Composition Editor's free-form surface. If you do not provide concrete parts derived from this abstract part, your users must derive their own concrete parts.
Deriving from a class that uses or contains template-based classes (such as collection classes) is possible with certain restrictions. To preserve the template implementation, you must define the part interface using a .vbe file; you cannot specify it properly through the Part Interface Editor. (If you do use the Part Interface Editor, VisualAge will issue an error message when it generates code for the part.) The alternative to using an interface file is deriving the part from an instance of the template-based class.
If the part is itself a class template, you must define any notification IDs in a separate IDs class. When used, these notification IDs must be scoped to the class in which they are implemented. (For example, to specify the itemChanged event in a notifyObservers call, use IVBContainerControlIds::itemChangedId. To specify the event associated with the selectedCnrElement attribute, use IContainerControl::selectId.) For examples of an IDs class, see the ivbids.hpp header file.
Otherwise, creating a class for a part is not much different from creating any other class. There are just a few additional guidelines to keep in mind for those member functions that support your part's interface. Before you get started, please read Constructors in Nonvisual Parts, Destructors in Nonvisual Parts, and Assignment Operators in Nonvisual Parts.
Constructors in Nonvisual Parts
Destructors in Nonvisual Parts
Assignment Operators in
Nonvisual Parts
Part Design Guidelines
Naming Guidelines for Parts and
Their Features
About Implementing Custom Visual
Parts
