Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Project Compatibility and Binary Compatibility ?

Posted on 2003-11-20
5
Medium Priority
?
693 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
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

824 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