RegAsm.exe 和 regsvr32 有什么区别? 如何使用regsvr32生成tlb文件?

发布于 2024-07-28 23:33:41 字数 72 浏览 2 评论 0原文

谁能告诉我 regsvr32 和 RegAsm 之间有什么区别? 我的 Dll 是 C# 语言,那么如何将类导入到 C++ 中?

Can any body tell me what is the difference between regsvr32 and RegAsm? My Dll is in C#, so how can I import the classes to c++?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莳間冲淡了誓言ζ 2024-08-04 23:33:41

regsvr32 将加载该库并尝试从该库调用 DllRegisterServer()。 它并不关心 DllRegisterServer() 实际执行的操作 - 它只是调用该函数并检查返回的值。 您可以使用它在非托管 DLL 中注册 COM 服务器。 它无法生成 .tlb 文件。

regasm 会将 COM 公开的 .NET 程序集注册为 COM 服务器。 您可以将其用于 .NET 程序集。 它可以仅在给定程序集的情况下生成 .tlb 文件 - 它检查程序集中存储的类型信息并将 COM 公开的实体包含到类型库中。

regsvr32 will load the library and try to call the DllRegisterServer() from that library. It doesn't care what DllRegisterServer() actually does - it just calls that function and checks the returned value. You use it to register COM servers in unmanaged DLLs. It can't generate a .tlb file.

regasm will register a COM-exposed .NET assembly as a COM server. You use it for .NET assemblies. It can generate a .tlb file given the assembly only - it inspects the type infromation stored in the assembly and includes the COM-exposed entities into the type library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文