winrt::guid_of 函数模板(C++/WinRT)

一个帮助程序函数模板,用于检索运行时类、coclass 或接口的 GUID;即 WinRT 类型的标识符。 对于 COM 和 WinRT 接口,这是接口的标识符。 对于 WinRT 类,它是类的默认接口的标识符。

仅当 guid_v (见函数的实现)不专用时,该函数才会回退到使用 __uuidof(如果适用)。

Syntax

template <typename T>
constexpr winrt::guid const& guid_of() noexcept;

Template parameters

typename T 要检索其 GUID 的运行时类、coclass 或接口的类型。

Return value

A winrt::guid value containing the globally unique identifier of T.

Requirements

支持的最低 SDK: Windows SDK 版本 10.0.17134.0(Windows 10 版本 1803)

Namespace: winrt

Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)

See also