编写COM组件的时候需要导出GUID,以下是代码示例。
extern "C" const GUID CLSID_Dictionary = { 0x54bf6567, 0x1007, 0x11d1, { 0xb0, 0xaa, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} } ; |
这种格式的GUID可以通过VS自带的GUID生成工具来生成.
以下是GUID各位的含义:
(来自:https://msdn.microsoft.com/en-us/library/windows/desktop/aa373931(v=vs.85).aspx )
Syntax C++
typedef struct _GUID { DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[8]; } GUID;
Members Data1 Specifies the first 8 hexadecimal digits of the GUID. Data2 Specifies the first group of 4 hexadecimal digits. Data3 Specifies the second group of 4 hexadecimal digits. Data4 Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits. |