How To Use Project and Binary Compatibility

Article translations Article translations
Article ID: 161137 - View products that this article applies to.
This article was previously published under Q161137
Expand all | Collapse all

On This Page

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.

REFERENCES

Visual Basic 5.0 Components Guide, Chapter 7, "Debugging, Testing, and Deploying Components"

Properties

Article ID: 161137 - Last Review: July 15, 2004 - Revision: 1.3
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
Keywords: 
kbhowto kbusage KB161137

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com