Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

COM Interface Guid

I'm not much into COM interfaces, so i have a small question, say I have this code:

[Guid("148BD528-A2AB-11CE-B11F-00AA00530503"), 
 InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IEnumWorkItems {
    [PreserveSig()]
    int Next([In] uint RequestCount, [Out] out System.IntPtr Names, 
                       [Out] out uint Fetched);
    void Skip([In] uint Count);
    void Reset();
    void Clone([Out, MarshalAs(UnmanagedType.Interface)] 
                          out IEnumWorkItems EnumWorkItems);
}

How do I know that "148BD528-A2AB-11CE-B11F-00AA00530503" corresponds to IEnumWorkItems : http://msdn.microsoft.com/en-us/library/aa380706(VS.85).aspx

Like if I want to know this interface's GUID : http://msdn.microsoft.com/en-us/library/aa381811(VS.85).aspx where do I find it?

like image 587
Enriquev Avatar asked Apr 13 '10 16:04

Enriquev


2 Answers

I've never encountered a formal documentation - there are, however, several ways to look it up:

  • Open the type lib (usually the server DLL itself) in OLE Viewer (included in visual studio tools)
  • looking it up in the SDK .idl's / .h's
  • write short VC++ program and use __uuidof(IInterface)
  • Looking it up under HKCR\Interface (though not all interfaces need to get registered there)
like image 166
peterchen Avatar answered Nov 15 '22 15:11

peterchen


In the registry, do a search for the class name in HKEY_CLASSES_ROOT, you will find the GUID

like image 33
Alex Avatar answered Nov 15 '22 16:11

Alex