VB - 以隐式方式链接DLL [英] VB - Linking a DLL in implicit way

查看:109
本文介绍了VB - 以隐式方式链接DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个VB6图形界面,我需要一个隐式链接到一个DLL。



这个动机来自我的前一个问题。这个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 moduleclause.

Compile with the MIDL compiler and reference the resulting tlb file from your VB6 project (Project - References).
And remove all Declare Functions.

The tlb file is only used for compilation (in this case), you don't have to include it into the setup.

这篇关于VB - 以隐式方式链接DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆