问题标签 [typelib]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
5 回答
31113 浏览

c++ - 如何从非托管 COM dll 生成类型库

我必须在我的 .NET 应用程序中使用第三方非托管 COM dll。我需要修改此程序集以生成自定义 RCW。为了编辑互操作程序集,我需要特定程序集的类型库。谁能解释一下如何从非托管 COM dll 生成类型库?

regsvr32 中没有生成类型库的选项。

谢谢你,最好的问候,机器人。

0 投票
2 回答
2309 浏览

delphi - IDL 到类型库

Delphi 7 中有没有办法从 idl 生成 tlb?甚至来自类/接口定义?

0 投票
4 回答
26574 浏览

visual-studio - Visual Studio - TYPE_E_REGISTRYACCESS

我正在构建我的 Visual Studio 解决方案,在输出窗口中只有一个项目出现错误。

在错误选项卡中:

在输出选项卡中:

有任何想法吗?

0 投票
1 回答
350 浏览

windows - Why not embed the typelib into the COM server and only ship it separately?

I'm analyzing a rather old COM server project in order to reuse some stuff from it and noticed a strange thing - in order to expose itself to the registry it implements a separate function different from DllRegisterServer() and that function accepts the path to the typelib and loads the typelib from that path and the typelib is shipped separately and can be located anywhere.

The typical solution is to just use ATL CComModule::RegisterServer() which will happily load the typelib from the same DLL if it is embedded as a resource. The DLL already uses ATL and this should be the most direct way.

I tried to find why the typelib is not embedded as a resource but looks like it was a very old design decision and noone can explain it.

I can see a reason for shipping the typelib separately - this way it's easier for COM server developers to #import it. But why not both ship it as a separate file and embed as a resource into the COM server DLL? I could imagine that the typelib increases the DLL size by several hundred kilobytes but can't find any other serious reason.

What could be the reasons for shipping the typelib as a separate file only?

0 投票
1 回答
622 浏览

c# - COM 类可见性:C# 到 VB6

我一方面有一个 C# .Net 4.0 应用程序,另一方面有一个 VB6 应用程序。我通过使 Project COM Visible 和 actived register COM Interop 创建了一个 COM 接口。

我通过实现一个导入新 tlb 文件的 C# 应用程序来测试 COM 接口。一切似乎都很好。

作为下一步,我尝试将 dll 与 vb6 一起使用。可以加载 dll,但现在我看不到所有公共类。在 C# 中,我在 vb6 中看到 4 个类,我只能看到 3 个。

我看不到的类是一个“特殊”类,因为它包含一个接口并服务于事件。

班级标有

COMEvents 接口就像

我不得不说一切都很好。比我添加的项目仅影响 COM 接口项目在运行时加载的其他程序集。他们实现了一个改变的接口。那是我对 com 接口所做的唯一更改是向方法添加附加参数。

为什么我再也看不到课程了?为什么只是我改变的课程而不是“冒险”的方式?

需要帮助谢谢!

PS:到目前为止,我尝试过:->所有项目都是构建 x86-> 在 x86 机器上构建项目-> Dependency Walker(缺少 GPSVC.DLL 和 IESHIMS.DLL,但他们以前也这样做过,我认为他们没有 anny效果导致 tlb 已构建并且可以加载)-> 尝试了 tlbexp.exe 但得到一个依赖错误,导致 assambly 运行时比当前运行时更新。wtf?)

0 投票
2 回答
937 浏览

delphi - _TLB 中自动生成的代码与生成它的 DLL 文件之间的关系

我有一个 DLL,我使用 Delphi 6 中 Project 下的 Import Type Library 功能将它作为类型库导入项目。我最近对 ​​_TLB.pas 文件和它生成的 DLL 之间的关系感到好奇。_TLB.pas 文件是用来代替库还是仅在我有代码接口的情况下使用?了解 _TLB.pas 中的代码如何与生成它的 DLL 一起工作的其他信息有哪些?

0 投票
2 回答
1033 浏览

delphi - 将 .net dll 导入 Delphi 6 会丢失信息

我有一个 .net dll 可以导入到 Delphi 6。但它丢失了一些信息。

我在 VB.net 中有一个演示应用程序来使用这个 dll,它显示了 2 个名为 IRedeemTransactionItemBundleITransactionItemBundle. 在 Visual Studio 2008 中,我可以看到这ITransactionItemBundleIRedeemTransactionItemBundle. 因此,当我声明一个 type 变量时IRedeemTransactionItemBundle,我可以访问两个接口的所有属性。

但是当我将 dll 导入 Delphi 6 时,我可以同时看到IRedeemTransactionItemBundle声明ITransactionItemBundle部分。但是没有信息表明ITransactionItemBundleIRedeemTransactionItemBundle. 此外,当我在 Delphi 中声明类型变量时IRedeemTransactionItemBundle,我无法访问ITransactionItemBundle(基本类型)的属性。

当我尝试通过将基本类型设置为IRedeemTransactionItemBundle来在 tlb 编辑器中注册库时ITransactionItemBundle,我收到错误消息:“父接口已经有一个 id:1610743808 的成员”。我可以在 tlb 编辑器中看到两个接口的属性具有相同的 ID。

我也尝试使用 Delphi 7 导入相同的 dll。但没有帮助。

这是德尔福的问题吗?你们有没有人在导入时遇到过这样的问题,请给我一些想法?

0 投票
1 回答
209 浏览

windows - 依赖 scrrun.dll 的可移植性如何?

我的资料中有以下指令:

#import <scrrun.dll>

我可以依赖 Windows 预装的这个 DLL 吗?

如何依靠这个限制可以使用的 Windows 版本?

0 投票
0 回答
107 浏览

c# - 我们如何从 COM 中的 PS(Proxy/Stub) 文件中提取 size_is 关系?

我需要从 C# 中的代理/存根中提取 size_is 和所有其他属性,例如“length_is”、“max_is”等属性信息,因为这些信息在制作类型库时被跳过,所以我不能使用 ITypeInfo 或 ITypeLib 接口来完成此任务.

有没有其他方法可以提取这些属性,我需要在 C# 中提取它。

问候乌斯曼

0 投票
2 回答
20804 浏览

c# - 将 TLB 导入 C#

我想将类型库 (tlb) 导入 C#。

如何将 a 导入.tlb代码.cs文件?


Borland Delphi 可以使用命令行工具.tlb导入:.pastlibimp.exe

现在有一个.pas源代码文件,其中包含已编译的类型库 (tlb) 文件中的常量、枚举、接口:

SopQuotingEngineActiveX_TLB.pas

将类型库导入本机 C# 代码的 .NET C# 等效项是什么?


注意:我已经尝试使用tlbimp.exeWindows SDK 附带的,但是将类型库导入到托管程序集 dll 中:

将类型库导入本机 C# 代码的 .NET C# 等效项是什么?


注意:我想看到的是一个.cs包含所有必需接口、常量、枚举的代码文件——调用 COM 对象所需的一切。例如:

SopQuotingEngineActiveX.cs

(除了没有错误)

也可以看看