Chapter 6. Versioning

If you know the phrase binary compatibility, you and I share the same pain. If you have never heard these words, then this chapter will spare you from the pain. This chapter is about versioning your COM components. Whenever I teach a course at a company, there is always a student who wants to know COM’s versioning scheme. People often have the idea that COM has a great versioning story. The truth is that COM’s versioning mechanism is very simple—once you have published an interface, you are not allowed to change it ever again. That’s it! If you never change interfaces that you have published, then you do not have a problem with versioning.

The reality, however, is that often we cannot live with an interface after it has been released without modifications. At the very least, we would like to extend the interface to add new functions. The truth is that COM interfaces cannot be changed, period, not even to add functionality. To understand why, let’s first discuss the goal of COM’s rigid versioning rule. Then we’ll discuss the different kinds of client programs and what each of them requires in terms of versioning. After that, we’ll talk about why it is difficult to version things in Visual Basic. Once we have discussed the problems, I will show you the mechanism that Visual Basic offers for versioning. Although I am a big fan of Visual Basic in general, I am not fond of VB’s versioning scheme. Therefore, at the end of the chapter, I will show you a better way ...

Get COM+ Programming with Visual Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.