RegAsm.exe 和 regsvr32 有什么区别?如何使用 regsvr32 生成 tlb 文件? [英] What is difference between RegAsm.exe and regsvr32? How to generate a tlb file using regsvr32?

查看:24
本文介绍了RegAsm.exe 和 regsvr32 有什么区别?如何使用 regsvr32 生成 tlb 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我 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++?

推荐答案

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

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 将把一个暴露在 COM 中的 .NET 程序集注册为一个 COM 服务器.您将其用于 .NET 程序集.它可以仅在给定程序集的情况下生成 .tlb 文件 - 它检查存储在程序集中的类型信息并将 COM 公开的实体包含到类型库中.

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.

这篇关于RegAsm.exe 和 regsvr32 有什么区别?如何使用 regsvr32 生成 tlb 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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