Functions


CoCreateGuid Function

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

Syntax

C++
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.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderObjbase.h
LibraryOle32.lib
DLLOle32.dll

See Also

UuidCreate

Send comments about this topic to Microsoft

Build date: 10/22/2009

Tags : guid


Page view tracker