Partilhar via


Visual Basic Concepts

Version Compatibility in ActiveX Components

A component can be part of another application because it provides Automation interfaces that the other application can manipulate. Each public class module has a default interface that includes all the properties and methods you added to the class module, plus any secondary interfaces implemented using the Implements feature.

Once your component has been used in an application — or, in the case of ActiveX controls, embedded in a document or on a Web page — you can change its interfaces only at the risk of breaking the client application.

Suppose, for example, that the Spin method of your Widget object has one argument, Speed. If you distribute a new version of your component, in which you redefine the Spin method so that it also requires a Direction argument, you could cause run-time errors in existing applications.

At the same time, a successful component will inevitably spark requests for enhancements. You will want to provide new objects, or add new properties and methods to existing objects. Occasionally you will even want to change the arguments of existing methods of existing objects.

The following topics describe the Version Compatibility feature of Visual Basic, which is designed to allow components to be enhanced without causing existing applications to fail.

For More Information   See "Polymorphism, Interfaces, Type Libraries, and GUIDs" in "General Principles of Component Design" for background information and concepts.