Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Binary Compatibility

Posted on 2002-07-12
3
Medium Priority
?
210 Views
Last Modified: 2010-05-02
I have an ActiveX dll I created that is in use by several clients.  I need to add some additional functionality that requires me to pass an additional piece of info to the component.

This may be a dumb question, but I will ask anyways.  Should I add the new parameter as a public property, or should I just add it as a parameter you have to pass to a method.  In otherwords, "Public Function MyMethod(ByVal MyNewParameter as String) As String".

Will either of these maintain binary compatibility?

Thanks,
DG
0
Comment
Question by:d_glenn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 7149480
If you ADD a property, binary compatibility will be maintained.
If you ADD a parameter, binary compatibility will break.
If you ADD a new function (MyFunctionEx), with the same parameters + the new one, compatibility will be maintained.

Depending on the usage, I take different choice. Most of the cases, I use both, adding the property to call the old function afterwards, or if the old function is called, it will in fact run the new function with some default value for this new parameter.

CHeers
0
 
LVL 5

Expert Comment

by:rpai
ID: 7149482
When you add new Public Property what you will be doing is basically enhancing your component. As long as you make no changes to existing properties and methods, Visual Basic updates the version number of the type library but keeps it compatible with the old version number. Client applications that are built using the new version of your component will compile with the new version number, and can make use of all the new features. They cannot be used with earlier versions of your component, however, because type library versions are only upward-compatible.

Adding a parameter to the Method will cause VB to make the version number of the type library incompatible, rendering the new version unusable with client applications compiled with earlier versions.

0
 
LVL 1

Author Comment

by:d_glenn
ID: 7149504
Thanks for both your help.  Exactly what I am looking for.  Since you both answered the question at the same time, you both deserve the points.

rpai, you can find your points here:

http://www.experts-exchange.com/visualbasic/Q_20322665
.html
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

670 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