HRESULT CoCreateGuid(GUID *pGuid);
#include <windows.h> #include <winbase.h> #include <ole2.h> GUID Guid; ... if (CoCreateGuid(&Guid)!=S_OK) { ... } ...