使用函数StringFromGUID2():Converts a globally unique identifier (GUID) into a string of printable characters.int StringFromGUID2(
  REFGUID rguid,  //GUID to be converted
  LPOLESTR lpsz,  //Pointer to resulting string
  int cchMax      //Size of array at lpsz
);
Parameters
rguid 
[in] GUID to be converted. 
lpsz 
[out] Pointer to a caller-allocated string variable to contain the resulting string on return. 
cchMax 
[in] Number of characters available in the buffer indicated by lpsz. 
Return Values
0 (zero) 
Array at lpsz is too small to contain a string representation of a GUID. 
Non-zero value 
The number of characters in the returned string, including the null terminator. 
Res
The string that the lpsz parameter receives has a format like that of the following sample:{c200e360-38c5-11ce-ae62-08002b2b79ef} 
where the successive fields break the GUID into the form DWORD-WORD-WORD-WORD-WORD.DWORD covering the 128-bit GUID. The string includes enclosing braces, which are an OLE convention.Requirements 
  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in objbase.h.
  Library: Use ole32.lib.See Also
StringFromCLSID