Solved

Project Compatibility and Binary Compatibility ?

Posted on 2003-11-20
5
562 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now