从exe文件检索COM进程id无需注册它 [英] Retrieve COM ProgID from exe without registering it

查看:168
本文介绍了从exe文件检索COM进程id无需注册它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:

我想提取从VB6应用程序中的COM数据,所以我可以(根据微软的最佳实践)应用程序正确注册。我使用WiX的3.0和heat.exe不会提取数据(已知的问题,热量),我没有相关的TLB文件随时访问。 VB6的应用程序没有兼容性打开,因此重新生成COM的GUID每次构建(他们希望让应用程序能够通过侧与旧版本并行运行。)

I would like to extract the COM data from a VB6 application so I can register it correctly (according to Microsoft best practice) the application. I am using WiX 3.0 and heat.exe will not extract the data (known issue with heat) and I do not have ready access to the associated TLB file. The VB6 application does not have compatibility turned on so it regenerates the COM GUIDs every build (They want to have the application be able to run side by side with an older version.)

我创建了一个C#应用程序,将收集的类型库,接口和伴生类信息从VB6应用程序而无需注册并创建了蜡烛使用WXS文件。我公司还有其他几个旧的应用程序是这样,我想使它成为一个更通用的解决方案。

I created a C# application that will collect the TypeLib, interface and CoClass information from the VB6 application without registering it and create a wxs file for candle to use. My company has several other older applications like this and I would like to make it a more generic solution.

的问题:

1.Is有没有办法从出项目或TLB文件和应用程序收集的真实的ProgID(程序员希望的一)不注册呢?

1.Is there a way to collect the 'true' ProgID (programmer intended one) from the application with out the project or TLB file and without registering it?

2.Is有没有办法找出从DLL预期的线程模型没有注册吗? (我打算,它可以处理所有的COM活跃的项目,很可能会成为完成)
谢谢你。

2.Is there a way to find out the intended Threading Model from a DLL without registering it? (I intend that it can handle all COM active items, might as well be complete) Thank you.

推荐答案

是,也不是。

据我所知,没有通用的方式来获得的ProgIDs出类型库或COM服务器。

As far as I know, there's no generic way to get ProgIDs out of a typelib or COM server.

的入口点的DLL是中的DllRegisterServer 这是应该的注册信息写入注册表,并为EXE服务器,他们通常有一个具有命令行参数同样的含义。

The entry point for DLLs is DllRegisterServer which is supposed to write registration information to the registry, and for EXE servers they usually have a command-line argument that has the same implication.

类型库会包含组件中的所有接口和组件类的描述,但他们很少包含人类可读的进程id。

Type libraries happen to contain a description of all interfaces and coclasses in the component, but they rarely contain the human-readable ProgID.

唯一明确的方式,我可以看到和建议是覆盖HKCR\CLSID关键指向暂时某处,然后调用中的DllRegisterServer 。由于注册表项替代过程是本地只会在进程内(DLL)服务器工作。

The only clear way I can see and recommend is to override HKCR\CLSID key to point to somewhere temporarily, and then call DllRegisterServer. As registry key overrides are process-local this will only work for in-process (DLL) servers.

请参阅的 http://msdn.microsoft.com/en-us/library/ms724901(v = VS.85)。 ASPX 有关重写注册表项信息。

See http://msdn.microsoft.com/en-us/library/ms724901(v=VS.85).aspx for info on overriding registry keys.

然后检查划痕注册表,看看发生了哪些变化,如CLSID< - >进程id映射,线程模型等。

Then inspect the scratch registry and see what changes were made, e.g. CLSID<->ProgID mappings, threading model, etc.

这篇关于从exe文件检索COM进程id无需注册它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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