开发者

COM Interface Guid

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

[Guid("148B开发者_Python百科D528-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?


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)


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜