|
-
March 13th, 2007, 07:29 AM
#1
GUIDs from ITypeLib
I have created a project with automation classes and - along with the executable - a type library is generated. Next, I use the ITypeLib interface to get information from the library. The library contains just about everything I would want to know about the class objects in the project but I haven't been able to get GUIDs of the objects.
For example, I create a CAutoObject and it is assigned a GUID for the IDispatch and one for the coclass. I build my project and then create an ITypeLib interface. From that interface I can get information about methods, properties, parameters, etc. but I have been unable to determine how to get the GUIDs or ICAutoObject.
Any ideas?
-
March 13th, 2007, 08:06 PM
#2
Re: GUIDs from ITypeLib
I seem to recall having encountered the same frustration and concluded it wasn't possible. Let me know if you find a way.
Henri Hein
Principal Engineer, Propel
Do not credit Propel with my views or opinions.
-
March 13th, 2007, 11:22 PM
#3
Re: GUIDs from ITypeLib
 Originally Posted by 0xC0000005
I have created a project with automation classes and - along with the executable - a type library is generated. Next, I use the ITypeLib interface to get information from the library. The library contains just about everything I would want to know about the class objects in the project but I haven't been able to get GUIDs of the objects.
For example, I create a CAutoObject and it is assigned a GUID for the IDispatch and one for the coclass. I build my project and then create an ITypeLib interface. From that interface I can get information about methods, properties, parameters, etc. but I have been unable to determine how to get the GUIDs or ICAutoObject.
Any ideas?
You can obtain the GUID from ITypeInfo interface ("GetTypeAttr" method) and TYPEATTR structure ("guid" field). You can look at source of AtlGetObjectSourceInterface to get the technique.
About ICAutoObject (if I understand clearly):
ITypeInfo::GetRefTypeOfImplType
HRESULT GetRefTypeOfImplType(unsigned int index, HREFTYPE* pRefType);
Comments
If the TKIND_DISPATCH type description is for a dual interface, the TKIND_INTERFACE type description can be obtained by calling GetRefTypeOfImplType with an index of –1, and by passing the returned pRefType handle to GetRefTypeInfo to retrieve the type information.
With best wishes,
Vita
-----------------------
Russian Software Development Network -- http://www.rsdn.ru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|