Vb6 活动 dll 正在创建新的类型库 (GUID)
Vb6 active dll is creating new typelib(GUID)
我修复了其中一个 VB6 组件中的一个问题,作为其中的一部分,我不得不编译一个我没有更改任何代码的依赖项控件。这里的问题是,当我编译依赖 ActiveX dll 时,依赖 ActiveX dll GUID 被更改为新的 GUID。我更改代码的组件没有更改 GUID。为什么我会看到这种行为?
来自 Visual Basic 6 概念指南,“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.
默认情况下,VB6 每次都会创建一个新的 GUID,除非您告诉它一个用于二进制兼容性的文件,然后它会尽可能使用该文件中的 GUID。这可能是一个奇怪的默认设置,但这就是它的工作原理,文档中的“Version Compatibility”部分描述了所有细节。
我修复了其中一个 VB6 组件中的一个问题,作为其中的一部分,我不得不编译一个我没有更改任何代码的依赖项控件。这里的问题是,当我编译依赖 ActiveX dll 时,依赖 ActiveX dll GUID 被更改为新的 GUID。我更改代码的组件没有更改 GUID。为什么我会看到这种行为?
来自 Visual Basic 6 概念指南,“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.
默认情况下,VB6 每次都会创建一个新的 GUID,除非您告诉它一个用于二进制兼容性的文件,然后它会尽可能使用该文件中的 GUID。这可能是一个奇怪的默认设置,但这就是它的工作原理,文档中的“Version Compatibility”部分描述了所有细节。