Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
COM
Expand Minimize

CoCreateGuid function

Creates a GUID, a unique 128-bit integer used for CLSIDs and interface identifiers.

Syntax


HRESULT CoCreateGuid(
  _Out_ GUID *pguid
);

Parameters

pguid [out]

A pointer to the requested GUID.

Return value

Return codeDescription
S_OK

The GUID was successfully created.

 

Errors returned by UuidCreate are wrapped as an HRESULT.

Remarks

The CoCreateGuid function calls the RPC function UuidCreate, which creates a GUID, a globally unique 128-bit integer. Use CoCreateGuid when you need an absolutely unique number that you will use as a persistent identifier in a distributed environment.To a very high degree of certainty, this function returns a unique value – no other invocation, on the same or any other system (networked or not), should return the same value.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

UuidCreate

 

 

Community Additions

ADD
Show:
© 2015 Microsoft