Solved

Project Compatibility and Binary Compatibility ?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

806 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