Why can't I browse dll to figure what's in it?: “Some components could not be browsed”

瘦欲@ 提交于 2019-12-11 05:52:40

问题


I'm looking for a missing COM interface X which I suspect is defined in Y.dll. I can peek at this presumptive interface using

grep X Y.dll

which says "matches". Hurrah, suspicion confirmed!

Alas, when I use the Object Browser in Visual Studio Express, trying to add Y.dll to my Custom Component Set, I get the error: "Some components could not be browsed" in a pop-up window.

So what are the reasons I can't browse this dll? Can the COM interfaces deliberately or accidentally be protected, hidden, secured, or obscured? Obviously I need a primer!

Officially, all Microsoft knows about this seems to be generally devoid of insight:

This error generally occurs when you attempt to add a file type that does not support object browsing, such as .htm and .txt files, in the Component Selector dialog box. The Object Browser supports file types such as .bsc, .olb, .tlb, .dll, .exe, and .ocx.

Seriously, what are the reasons for a dll or exe to not support object browsing? Any pointers to tutorials or books would be appreciated by this beginner! Thanks.


回答1:


COM Object browsers rely on metadata (type libraries) exported by COM servers (dll, exe, ocx, etc).

The problem is that COM Servers are not required to export any metadata about which interfaces it implements. Unfortunately I have found quite a number of such servers (so one needs to know which CoClasses, Interfaces, etc are supported by other means).

Check if your COM Server (y.dll) contains a resource called "TYPELIB" similar to:

Hope this helps.



来源:https://stackoverflow.com/questions/13897610/why-cant-i-browse-dll-to-figure-whats-in-it-some-components-could-not-be-br

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!