Obtaining the list of COM interfaces

This forum is reserved for everything you want to talk about. It could be about programming, opinions, open source programs, development in general, or just cool stuff to share!
Post Reply
mastupristi
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Oct 18, 2005 7:52 am

Obtaining the list of COM interfaces

Post by mastupristi » Tue Oct 18, 2005 9:29 am

We use Windows XP and WxDev-c++.
We usually use USB/serial interfaces. These interfaces are mapped as different COM interface.
How can I obtain the list of COM interface Installed in a system?

thanks

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Tue Oct 18, 2005 9:48 am

Hi!
Maybe this could be of use
http://www.iftools.com/ctb.en.html
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

mastupristi
Knows some wx things
Knows some wx things
Posts: 28
Joined: Tue Oct 18, 2005 7:52 am

Post by mastupristi » Tue Oct 18, 2005 10:20 am

upCASE wrote:Maybe this could be of use
http://www.iftools.com/ctb.en.html
#-o
I only need to obtain the list of active COM interface from windows.
I tried to take a look to CTB, but it doesn't seem to help...

thanks

Oliver
Earned a small fee
Earned a small fee
Posts: 13
Joined: Mon Oct 10, 2005 5:32 pm

Post by Oliver » Tue Oct 18, 2005 12:43 pm

You cannot get a list of COM interfaces on a system in an efficient way.

You can get the COM components that support certain interfaces and are registered in categories (see ICatInformation), or you can get a COM component and ask the component for each interface you require.

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Post by Ryan Norton » Thu Oct 27, 2005 9:41 pm

Oliver wrote:You cannot get a list of COM interfaces on a system in an efficient way.
The OLEVIEW.EXE or whatever the ole viewer that comes with VC++ can do that I believe. I'm pretty sure as long as they are registered you can get them... it requires some registry digging though and has little practical use...
[Mostly retired moderator, still check in to clean up some stuff]

Oliver
Earned a small fee
Earned a small fee
Posts: 13
Joined: Mon Oct 10, 2005 5:32 pm

Post by Oliver » Fri Oct 28, 2005 7:18 am

Yes, the OLEViewer does, but not in an efficient way that is recommended for commonly used components. It is true that this requires traversing of the registry.

Imagine you had just few (non-service) components traversing the registry for certain interfaces every time they are created! Remember that components can be created by any client at any time, whoever knows how often. Or imagine the MediaPlayer or maybe WinAmp would do so in search for Codecs - starting up these applications would be a nightmare.

Anyway, I am not sure what the OP means by "these interfaces are mapped as different COM interface". Interfaces are exposed by component, so the OP's first task would be to find the components that provide the interfaces he needs. If he's got the component, he can query it for the interfaces. If he just finds the IIDs, he's got nothing because he can not create the interface without the exposing component(s) which is not referenced from the IID.

I guess that the OP means that he needs to find components that provide some specific interfaces. If this is the case, categories are clearly the way to go if the components registered itself in a category. Otherwise, there is no efficient or commonly recommended way to accomplish this.

Post Reply