VB - 以隐式方式链接DLL [英] VB - Linking a DLL in implicit way
问题描述
这个动机来自我的前一个问题。这个DLL使用静态TLS, __ declspec(thread)
,当然,当DLL使用LoadLibray显式链接时,这可能会非常糟糕。
我真的很想避免修改DLL,有没有人知道如何欺骗VB6可执行文件来隐式链接到一个特定的DLL?
为您的DLL创建一个IDL文件,该文件描述您在 module
子句。
编译MIDL编译器并引用您的VB6项目的tlb文件(项目 - 参考)。
并删除所有声明函数
s。
tlb文件仅用于编译(在这种情况下为 ),您不必将其包含在设置中。
I'm working on a VB6 graphic interface and I need to make an implicit linking to a DLL.
The motivation for this comes from my previous question. The DLL in question uses static TLS, __declspec(thread)
, and of course this fails horribly when the DLL is linked explicitly using LoadLibray.
I'd really like to avoid modifications to the DLL, so does anyone know how to trick a VB6 executable to link to a specific DLL implicitly?
Create an IDL file for your DLL that describes your exported functions in a module
clause.
Compile with the MIDL compiler and reference the resulting tlb file from your VB6 project (Project - References).
And remove all Declare Function
s.
The tlb file is only used for compilation (in this case), you don't have to include it into the setup.
这篇关于VB - 以隐式方式链接DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!