Solved

Project Compatibility and Binary Compatibility ?

Posted on 2003-11-20
5
589 Views
Last Modified: 2008-03-06
What actually Project Compatibility and Binary Compatibility mean and what is the difference between them ?
0
Comment
Question by:Amita
  • 2
5 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 100 total points
ID: 9785856
Compatibility In Visual Basic
When an ActiveX component is compiled, there are three possible project compatibility settings:
No Compatibility
Project Compatibility
Binary Compatibility
No Compatibility
With this setting, new class ID’s, new interface ID’s and a new type library ID will be generated by VB each time the ActiveX component project is compiled. This will cause any compiled client components to fail (with error 429!) and report a missing reference to the 'VB ActiveX Test Component' when a client project is loaded in the VB IDE.

 TIP:  Use this setting to compile the initial release of a component to other developers.

Project Compatibility
With this setting, VB will generate new interface ID’s for classes whose interfaces have changed, but will not change the class ID’s or the type library ID. This will still cause any compiled client components to fail (with error 429!) but will not report a missing reference to the 'VB ActiveX Test Component' when a client project is loaded in the VB IDE. Recompilation of client components will restore them to working order again.

 TIP:  Use this setting during the initial development and testing of a component within the IDE and before the component is released to other developers.

Binary Compatibility
VB makes it possible to extend an existing class or interface by adding new methods and properties etc. and yet still retain binary compatibility. It can do this, because it silently creates a new interface ID for the extended interface and adds registration code to register the original interface ID but with a new Forward key containing the value of this new interface ID. COM will then substitute calls having the old ID with the new ID and hence applications built against the old interface will continue to work (assuming the inner workings of the component remain backward compatible!).

With this setting, VB will not change any of the existing class, interface or type library ID’s, however in order that it can do so, VB requires the project to specify an existing compiled version that it can compare against to ensure that existing interfaces have not been broken.

 TIP:  Use this setting following the release of a component to other developers.

Breaking Compatibility
When the need to break compatibility arises, be sure to tackle it head on and make a clean break. To do so, create a new version of the project with compatibility set to 'No Compatibility'. Next, change the project 'Name' attribute and compile to a different component name. Taking this approach ensures that existing applications can continue to work with the old component while new versions can use the new component.

For more information:
--> http://www.visibleprogress.com/vb_binary_compatibility.htm
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 9785858
HOWTO: Use Project and Binary Compatibility
--> http://support.microsoft.com/default.aspx?kbid=161137
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9786074
Interesting ... :-)
0
 

Author Comment

by:Amita
ID: 9794747
So when my application and ActiveX component is under development...i should  use Project Compatibility......but before making the final release of my project , i should set it to Binary compatibility...am i correct ?
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question