Re: COM component GUID
Valentine R <ValentineR@discussions.microsoft.com> wrote:
The input is dll (with COM component implementation) or tlb file. I
have to get GUID of this component. How can I do it?
You mean, programmatically? You obtain ITypeLib pointer with
LoadTypeLib, then call GetTypeInfoCount and GetTypeInfoType looking for
TKIND_COCLASS elements. For each of those (there may be more than one
implemented in a single DLL), call GetTypeInfo to obtain ITypeInfo
interface. Finally, call ITypeInfo::GetTypeAttr - the GUID is in the
TYPEATTR structure. When done with it, call ReleaseTypeAttr.
If you mean just doing it by hand, Platform SDK ships with OLE/COM
Object Viewer tool. In this tool, you can open a TLB (or a DLL with TLB
attached as a resource, as is customary) and it will show you all the
classes and interfaces in the type library, complete with their GUIDs.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925