简体   繁体   English

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

[英]What is difference between RegAsm.exe and regsvr32? How to generate a tlb file using regsvr32?

Can any body tell me what is the difference between regsvr32 and RegAsm? 任何机构都可以告诉我regsvr32和RegAsm有什么区别? My Dll is in C#, so how can I import the classes to c++? 我的Dll在C#中,那么如何将类导入到c ++中呢?

regsvr32 will load the library and try to call the DllRegisterServer() from that library. regsvr32将加载库并尝试从该库调用DllRegisterServer() It doesn't care what DllRegisterServer() actually does - it just calls that function and checks the returned value. 它并不关心DllRegisterServer()实际上做什么 - 它只是调用该函数并检查返回的值。 You use it to register COM servers in unmanaged DLLs. 您可以使用它在非托管DLL中注册COM服务器。 It can't generate a .tlb file. 它无法生成.tlb文件。

regasm will register a COM-exposed .NET assembly as a COM server. regasm将COM暴露的.NET程序集注册为COM服务器。 You use it for .NET assemblies. 您将它用于.NET程序集。 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. 它只能在程序集中生成.tlb文件 - 它会检查程序集中存储的类型信息,并将暴露于COM的实体包含在类型库中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM