[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

[Type libraries] Getting the name of an Interface Identification...

Posted on 2003-10-29
3
Medium Priority
?
643 Views
Last Modified: 2008-02-01
I have a type library. The type library has a method that returns an IID of another COM class. I now need to know which class this IID belongs to.

Okay, first answer: use StringFromIID()... Well, wrong since this just returns me the GUID as a string.
Second answer: use ProgIDFromCLSID()... Wrong again since this method requires a CLSID, not an IID. The difference? CLSID's are registered in the registry...
Thirs answer: just maintain a list of possible GUID's in the type library and do a lookup of each GUID in an internal table. Okay, this works but it's not a good solution.

In other words, I need a better solution...

For those of you who use the ADO type library, one of the COM IID's that I try to convert to some readable text is IID__Recordset {00000555-0000-0010-8000-00AA006D2EA4} but the system will not provide me the proper name for this GUID. I know it is possible since Delphi can do this when it opens a type library. So what am I missing here???

I guess I'm missing the link to related type libraries. In other words, the dependency list of the type library... Guess I have to load the dependencies and then look into these type libraries to translate the IID correctly...
0
Comment
Question by:Wim ten Brink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
velter earned 1000 total points
ID: 9661141
You need to open the type lib and find the interface in it

Example to read the IID__Recordset Description

1 - Read the regsitry key HKCR\Interface\{00000555-0000-0010-8000-00AA006D2EA4}\TypeLib
This will give you the GUID of the typelib : {00000300-0000-0010-8000-00AA006D2EA4}

1 - Read the regsitry key HKCR\Interface\{00000555-0000-0010-8000-00AA006D2EA4}\TypeLib\Version
This will give you the version of the typelib : 2.5

2 - Read the registry key HKCR\TypeLib\{00000300-0000-0010-8000-00AA006D2EA4}\2.5\0\win32
This will give you the path of the type lib : C:\Program Files\Fichiers communs\System\ado\msador15.dll (for my system, might be different on yours)

3 - Load the typelib
LoadTypeLib('C:\Program Files\Fichiers communs\System\ado\msador15.dll',oTypeLib)

4 - Get the type info
oTypeLib.GetTypeInfoOfGuid(StringToGUID('{00000555-0000-0010-8000-00AA006D2EA4}',oTypeInfo)

4 - Get the name / doc string / help
oTypeInfo.GetDocumentation(MEMBERID_NIL,oName,oDocString,oHelpContext,oHelpFile);
0
 
LVL 17

Author Comment

by:Wim ten Brink
ID: 9758712
Ewwwwwwww... I dislike that solution because I need to look into the registry. I am quite familiar with the registry, therefore I try to avoid using it as much as possible. It works but wonder if there's a non-registry solution too. So I keep this question open for a while and if someone provides a non-registry solution in the next two weeks, I'll double the points and split them between you and the other answer.
0
 
LVL 17

Author Comment

by:Wim ten Brink
ID: 9896054
It seems to work okay and no one else could provide a better solution so, points to velter.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question