Reputation: 35
I fixed an issue in one of the VB6 component and as part of that I had to compile one of the dependency control which I haven't changed any code. The problem here is, the dependency ActiveX dll GUID is got changed to new GUID when I compiled the dependency ActiveX dll. the component where I changed code didn't change GUID. Why I am seeing this kind of behavior?
Upvotes: 0
Views: 509
Reputation:
From the Visual Basic 6 Concepts Guide, "Version Compatibility for Interfaces":
During development of a new component Visual Basic generates new IIDs every time you compile, as long as either Project Compatibility or No Compatibility is selected on the Component tab of the Project Properties dialog box. New CLSIDs are also generated if No Compatibility is selected; CLSIDs are maintained if Project Compatibility is selected. Once you’ve released a component, however, and begin working on an enhanced version of it, you can use the Binary Version Compatibility feature of Visual Basic to change this behavior.
As described in detail in "Version Compatibility" in "Debugging, Testing, and Deploying Components," binary version compatibility preserves the class IDs and interface IDs from previous versions of your component. This allows applications compiled using previous versions to work with the new version.
By default, VB6 will make a new GUID each time, unless you tell it a file to use for Binary Compatibility, and then it will use the GUIDs in that file if possible. It may be an odd default, but that's how it works, and that "Version Compatibility" section in the documentation describes all the details.
Upvotes: 1