Assure Compatibility

When working with ActiveX DLLs, many VB programmers build a reference DLL first, copy it to a subdirectory of the project directory, and set version compatibility to binary with a pointer to the reference build. Many of these same programmers believe-or have been taught-they can now forget about compatibility because VB prevents them from ever building an incompatible version. They’re dead wrong. Suppose you later add a method to one of the public classes in the project, which is defined as:

 Public Sub DoSomething(Prm1 As String, _	Prm2 as Integer)

Version 2, which includes the new DoSomething method, is built without VB complaining, because the new build is version-compatible. For example, you might modify and recompile client applications to take advantage of the new method.Suppose you change the Prm2 parameter of DoSomething from Integer to Long to prevent an overflow error. Ordinarily, such a change breaks backward compatibility. But, because the reference build is version 1, which doesn’t have the DoSomething method, VB assumes it’s completely new and happily builds version 3. The truth, however, is that this change does break compatibility, and all the client applications of version 2 crash with runtime error 430, “Class doesn’t support Automation.”

Changing a parameter’s type isn’t the only way a programmer can fool VB into thinking it’s maintaining binary compatibility. In fact, removing or changing any method or property that wasn’t in version 1 does it, as well as removing a class that wasn’t in version 1.

When working with ActiveX DLLs, the only way to ensure ongoing compatibility is by updating your reference build after each change in the interface(s) it exposes. You should always point the reference to your last-shipped build, which assures that each version is compatible with the last-shipped version.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may