Can any one provide a list of scenarios when the binary compatibility of a dll is broken. Also if some dlls are refering this dll(binary compatibility is broken) then when they should be recompiled.
In short EVERYTHING that used to be there must still be there and it must be EXACTLY the same as it was before. If only the slightest bit is changed, then your binary compatability has been broken.
Any client referencing a COM server whose bin comp has been broken will have to be recompiled against the new public interface.
It's OK to add functionality, but you can't take anything away.
This includes adding parameters to existing functions. If you were to insert a new parameter at the start of the list of parameters, then from the compiler's viewpoint you took something away. Add new parameters to the end of the parameters lists. Better yet, write a new function that has the new argument list, and have it call the original one (polymorphism).
I think yes, because the vtable offsets probably have been changed in dll 1. You'll probably get automation errors because of this scenario.
Greetings,
Rick
I call the fact that you can add methods to a vb class without breaking compatibility a bug more than anything. As stated before ANY change to the public interface should change the compatibility. The fact that VB allows what it does now is a problem because it means that if you have class X and add method Y the can program Z uses method Y but you install Program Z on machine A with the old Class X then it will work until it hits method Y and dependent on what you have done it might break earlier.
I suppose if you write software for internal use only, this might seem annoying. But if you write software for sale, then this becomes a very nice thing to have -- if you need to add functionality to a module, you can (carefully!) add it, without requiring a re-compile and re-ship of all COM components that make use of it.
It does, however, require you to have excellent change-control management to avoid DLL hell.
The problem is not only whether or not older clients and newer clients will be able to work with the new component. COM is all about interfaces. And once an interface has been published, you should NEVER change anything about it. An interface is like a contract between a COM server and its clients. When a specific interface is supported in a COM server a client should ALWAYS be able to rely on the fact that all methods, typedefs etc. are there. And if you were to add methods to an existing server, you should add a new interface for these methods. This case a client will be able to query for a certain interface and not crash because of missing methods.
I understand exactly your argument... but for the sake of completeness ( and me!!) can you illustrate how you add a second (or third) interface to a VB COM object.
Yeah, you got me there (I always program COM in C).
But I think you can try this:
Create an empty class which only holds the public interface, NO implementation. use the implements keyword in your COM object and implement the interface there. I think this should work.
Greetings,
Rick
There exists an add-in that really can help to keep binary compatibility in most cases no matter you change the public interface.
This add-in can lead you directly into dll-hell that's true. But during the development of an application with many activeXs it can save so much time when you haven't to recompile all again and again... mostly in a certain order...
All the sugestions above are right and would be the better way I think... but sometimes you really have to keep binary compatibility.
The add-in is called Binary Compatibility Add-in (SyncCmp) and can be found on
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.