Muokkaa

Jaa


Platform::Guid value class

Represents a [GUID](/windows/win32/api/guiddef/ns-guiddef-guid type in the Windows Runtime type system.

Syntax

public value struct Guid

Members

Platform::Guid has the Equals(), GetHashCode(), and ToString() methods derived from the Platform::Object Class, and the GetTypeCode() method derived from the Platform::Type Class. Platform::Guid also has the following members.

Member Description
Guid Initializes a new instance of a Platform::Guid.
operator== Equals operator.
operator!= Not equals operator.
operator< Less than operator.
operator() Converts a Platform::Guid to a GUID.

Remarks

To generate a new Platform::Guid, use the Windows::Foundation::GuidHelper::CreateNewGuid static method.

Requirements

Minimum supported client: Windows 8

Minimum supported server: Windows Server 2012

Namespace: Platform

Metadata: platform.winmd

Guid::Guid Constructors

Initializes a new instance of a Platform::Guid.

Syntax

Guid(
    unsigned int a,
    unsigned short b,
    unsigned short c,
    unsigned char d,
    unsigned char e,
    unsigned char f,
    unsigned char g,
    unsigned char h,
    unsigned char i,
    unsigned char j,
    unsigned char k );

Guid(GUID m);

Guid(
    unsigned int a,
    unsigned short b,
    unsigned short c,
    Array<unsigned char>^ n );

Parameters

a
The first 4 bytes of the GUID.

b
The next 2 bytes of the GUID.

c
The next 2 bytes of the GUID.

d
The next byte of the GUID.

e
The next byte of the GUID.

f
The next byte of the GUID.

g
The next byte of the GUID.

h
The next byte of the GUID.

i
The next byte of the GUID.

j
The next byte of the GUID.

k
The next byte of the GUID.

m
A GUID in the form a GUID structure.

n
The remaining 8 bytes of the GUID.

Guid::operator== Operator

Compares two Platform::Guid instances for equality.

Syntax

static bool Platform::Guid::operator==(Platform::Guid guid1, Platform::Guid guid2);

Parameters

guid1
The first Platform::Guid to compare.

guid2
The second Platform::Guid to compare.

Return Value

True if the two Platform::Guid instances are equal.

Remarks

Prefer using the == operator instead of the Windows::Foundation::GuidHelper::Equals static method.

Guid::operator!= Operator

Compares two Platform::Guid instances for inequality.

Syntax

static bool Platform::Guid::operator!=(Platform::Guid guid1, Platform::Guid guid2);

Parameters

guid1
The first Platform::Guid to compare.

guid2
The second Platform::Guid to compare.

Return Value

True if the two Platform::Guid instances are not equal.

Guid::operator< Operator

Compares two Platform::Guid instances for ordering.

Syntax

static bool Platform::Guid::operator<(Platform::Guid guid1, Platform::Guid guid2);

Parameters

guid1
The first Platform::Guid to compare.

guid2
The second Platform::Guid to compare.

Return Value

True if guid1 is ordered before guid2. The ordering is lexicographic after treating each Platform::Guid as if it's an array of four 32-bit unsigned values. This isn't the ordering used by SQL Server or the .NET Framework, nor is it the same as lexicographical ordering by string representation.

This operator is provided so that Guid objects can be more easily consumed by the C++ standard library.

Guid::operator() Operator

Implicitly converts a Platform::Guid to a GUID structure.

Syntax

const GUID& Platform::Guid::operator();

Return Value

A GUID structure.

See also

Platform namespace