【发布时间】:2010-10-26 03:56:53
【问题描述】:
我在 Visual Studio 6 C++ 中编写了一个标准 DLL。我还编写了一个 typelib 来配合它,以便它可以直接在 VB6 中使用,而不是通过 Declare。
它在 Windows XP 下的 VB6 中运行良好。
当我将 DLL 和 TLB 带入 Vista 和 Windows7 时不起作用。 .TLB 可以很好地使用REGTLIB 注册,但在 Visual Studio 2008 中唯一可见的符号是Attribution 常量。
我试图模仿的技术位于How To Make C DLL More Accessible to VB with a Type Library。是不是这种技术不再适用???
(缩写的)ODL 代码复制如下。知道发生了什么吗?
// This is the type library for BOBDE.dll
[
// Use GUIDGEN.EXE to create the UUID that uniquely identifies
// this library on the user's system. NOTE: This must be done!!
uuid(EE090BD0-AB6C-454c-A3D7-44CA46B1289F),
// This helpstring defines how the library will appear in the
// References dialog of VB.
helpstring("BOBDE TypeLib"),
// Assume standard English locale.
lcid(0x0409),
// Assign a version number to keep track of changes.
version(1.0)
]
library BOBDE
{
// Now define the module that will "declare" your C functions.
[helpstring("Functions in BOBDE.DLL"), version(1.0),dllname("BOBDE.dll")]
module BOBDEFunctions
{
[helpstring("Blowfish Encode ASCII for ANSI"), entry("BEA_A")]
void __stdcall BEA_A( [in] BSTR p1, [in] BSTR p2, [out,retval] BSTR* res );
// other very similar functions removed for the sake of brevity
const LPSTR Attribution = "This product includes cryptographic software written by Eric Young (eay@cryptsoft.com)";
} // End of Module
}; // End of Library
【问题讨论】:
标签: visual-studio-2008 vb6 midl