What's the C++ version of Guid.NewGuid()?

前端 未结 7 1566
栀梦
栀梦 2021-01-31 14:04

I need to create a GUID in an unmanaged windows C++ project. I\'m used to C#, where I\'d use Guid.NewGuid(). What\'s the (unmanaged windows) C++ vers

7条回答
  •  长情又很酷
    2021-01-31 15:04

    I think CoCreateGuid is what you're after. Example:

    GUID gidReference;
    HRESULT hCreateGuid = CoCreateGuid( &gidReference );
    

提交回复
热议问题