如何知道哪个COM组件调用某个PIA?组件、COM、PIA

2023-09-04 23:16:13 作者:深情必死

我安装在我的箱子一个PIA,它是 Microsoft.mshtml 。如果我没有understandd吧,这些PIA是由微软提供,以减轻我们的COM互操作的生活。但我想知道哪个COM组件实际上是包裹/叫这PIA。因为我有一个UnauthorizedAccessException,我想找到实际的COM组件并使用的 DCOMCNFG.EXE 的给予其适当的权限。我希望这是正确的方向。

I got a PIA installed on my box, it is Microsoft.mshtml. If I understandd it correctly, these PIA is provided by Microsoft to ease our life of COM interop. But I want to know which COM component is actually wrapped/called by this PIA. Because I am having a UnauthorizedAccessException, I want to locate the actual COM component and use dcomcnfg.exe to grant it proper permission. I hope this is the right direction.

谢谢!

推荐答案

这是C:\ WINDOWS \ SYSTEM32 \ Mshtml.dll的。我严重怀疑,DCOMCNFG.EXE是要解决问题,这是一个进程内COM服务器。你可能会使用Sysinternals的讨论procmon工具,看看到底是哪个注册表或文件访问正在生成异常得到更深入的了解。查找错误code 5。

It is c:\windows\system32\mshtml.dll. I seriously doubt that dcomcnfg.exe is going to solve your problem, this is an in-process COM server. You might get more insight by using Sysinternals' ProcMon utility to see exactly which registry or file access is generating the exception. Look for error code 5.

您只需要在PIA,当你在自己的公开课公开从COM服务器类型。并不常见。 PIA的是历史与VS2010了不起的嵌入互操作类型选项。绰号无软的选项。你避开PIA与项目+添加引用,浏览选项卡中,选择C:\ WINDOWS \ SYSTEM32 \ MSHTML.tlb的。在早期版本的Windows的.dll文件。

You only need the PIA when you expose types from that COM server in your own public classes. Not that common. PIAs are history with the terrific "Embed Interop Types" option in VS2010. Nicknamed the "no pia" option. You avoid the PIA with Project + Add Reference, Browse tab, select c:\windows\system32\mshtml.tlb. The .dll in earlier versions of Windows.