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

StackOverflow https://stackoverflow.com/questions/13897610

سؤال

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.

هل كانت مفيدة؟

المحلول

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:

COM typelib resource

Hope this helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top