Extending ArcObjects  

Class Extensions for Annotation and Dimensions

This topic is relevant for the following:
Product(s): ArcGIS Desktop: All
Version(s): 9.0, 9.1, 9.2, 9.3
Language(s): VB6, VC++
Experience level(s): Intermediate to advanced

You cannot easily implement a class extension on an annotation or dimension feature class. They already use class extensions, so implementing your own would overwrite the existing extension, leading to problems.

You can, however, aggregate the existing class extension object, though there are some disadvantages to this approach.

First, Visual Basic does not currently support COM aggregation, so you will need to use Visual C++ to implement the class extension. Secondly, you should only implement interfaces that are not already implemented by the existing class extension. For example, when aggregating AnnotationFeatureClassExtension you could implement IObjectClassValidation but not IRelatedObjectClassEvents. This is because aggregation can't be used to modify the existing behavior of an implemented interface—if you overrode an interface, the existing behavior would be lost. There is an additional theoretical possibility that in the future the aggregated object may implement additional interfaces, possibly resulting in a clash with your class extension.

Back to top

See Also About Class Extensions, PipeValidation Class Extension, Timestamper Class Extension Example, Class Extensions and Relationship Classes, and Managing Class Extensions.