Microsoft KB Archive/161137

= How To Use Project and Binary Compatibility =

Article ID: 161137

Article Last Modified on 7/15/2004

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q161137



SUMMARY
The Compatibility setting allows you to determine the Visual Basic project's compatibility to older versions of the ActiveX Components generated from the project.

The ActiveX Components you create contain a default interface (for example, CName_D where CName is the ClassName for the ActiveX Component) that contains all of the methods and properties you have created. If your Class raises events, you also have an additional interface called IConnectionPointContainer. When you build an ActiveX Control or Server, these Interfaces are given a unique identifier. If you modify your control or server, these interfaces may change. Any applications using an older version of your component may fail at this point. To ensure that your new and old interfaces will work with all applications, you need to set the appropriate Compatibility setting.



MORE INFORMATION
You can set the Project's Compatibility in the Project\Properties dialog box, under the Component tab.

Visual Basic has three different compatibility settings for Projects:


 * No compatibility.
 * Project compatibility.
 * Binary compatibility.

No Compatibility
With this setting, no compatibility is enforced. Visual Basic creates new Interface IDs and Class IDs every time you build or compile your project. Each version built can only be used with applications created to work with that specific build of the component.

Project Compatibility
With this setting, you can make your project compatible to a specific component project. While new type library information is generated, the type library identifier is maintained so that test projects can still refer to the component project. This setting is for maintaining compatibility during testing. Therefore, once the component is released, it behaves the same as the No Compatibility setting.

Binary Compatibility
When you compile your project, Visual Basic only creates new Class and Interface IDs when necessary. It preserves the class and interface IDs from the previous version(s) so that programs compiled using an earlier version will continue to work. If you are making a change that will result in an incompatible version, Visual Basic will warn you. If you want to maintain compatibility with older, released versions of an ActiveX component, this is the setting you need to use.

