c++ - 导出 COM 注册信息

标签 c++ dll com registration ocx

是否有可能以任何语言(c/c++/c#、VB 等我不关心)导出所有 COM 注册信息(例如 clsid、progid、typelib、interface、appid ETC)?或者您是否知道可以导出该信息(包括所有 32 位和 64 位信息)的可靠工具?

基本上我想做的是 regsvr32 所做的,但“在一个文件中”,而不是将其写入注册表。解决方案可以是 API 调用或程序集类或任何支持我这样做的东西,也可以是一个可以将信息导出到文件的工具。请注意,该工具(如果是的话)应对 COM 和互操作程序集执行此操作。 (我对 wisecomcaputure 或 adminstudio 的等价物不感兴趣)

为了澄清,我的观点在这里: 我是一名安装工程师。我基本上想知道一种方法来获取通常通过调用 regsvr32 放置在注册表中的 COM 或互操作对象的所有注册信息。

我很高兴得到任何帮助或提示

伊莲娜

最佳答案

有一个鲜为人知但非常方便的 API:RegOverridePredefKey .它允许完全按照您的要求进行操作:

The RegOverridePredefKey function is intended for software installation programs. It allows them to remap a predefined key, load a DLL component that will be installed on the system, call an entry point in the DLL, and examine the changes to the registry that the component attempted to make. The installation program can then write those changes to the locations intended by the DLL, or make changes to the data before writing it.

关注the docs了解更多详情。重新映射 HKEY_CLASSES_ROOT 键并调用 COM 服务器的 DllRegisterServer 后,使用 RegSaveKey将重新映射的 key 保存到文件,处理文件并将映射更改回 HKEY_CLASSES_ROOT

关于c++ - 导出 COM 注册信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23427797/

相关文章:

c++ - 转换为 Type&& 运算符的类型

c++ - 如何访问(例如,cout)多维 STL vector 中迭代器的当前值 (C++)

c# - 如何从 .Net DLL 获取公共(public)导出列表?

c++ - C++静态库中的共享全局变量 : Linux

.NET 框架和 COM

delphi - 我找到了 ComClass,现在如何引用它?

c++ - 为什么下面的多线程代码会导致 SIGABRT ?

c++ - 为什么char数据的地址不显示?

.net - .Net 标准 DLL 项目的构建文件夹中缺少 Nuget Pkg Dll。 dll 不是复制本地的吗?在 Visual Studio 2019 中修复?

delphi - 如何在Delphi 7中获取GIT?