winrt::d etach_abi (C++/WinRT)

Fungsi pembantu yang mencopot objek C++/WinRT dari handel yang dirujuk, atau dari antarmuka yang dirujuk. Melepaskan dari antarmuka dilakukan tanpa mengurangi jumlah referensi, mungkin untuk mengembalikannya ke pemanggil. Untuk informasi selengkapnya, dan contoh kode, lihat Interop antara C++/WinRT dan ABI.

Sintaks

template <typename T, typename =
std::enable_if_t<!std::is_base_of_v<winrt::Windows::Foundation::IUnknown, std::decay_t<T>>
&& !std::is_convertible_v<T, std::wstring_view>>>
auto detach_abi(T&& object);

inline void* detach_abi(winrt::Windows::Foundation::IUnknown& object) noexcept;

inline void* detach_abi(winrt::Windows::Foundation::IUnknown&& object) noexcept;

constexpr void* detach_abi(std::nullptr_t) noexcept;

template <typename T>
void* detach_abi(winrt::com_ptr<T>& object) noexcept;

inline void* detach_abi(winrt::hstring& object) noexcept;

inline void* detach_abi(winrt::hstring&& object) noexcept;

inline void* detach_abi(std::wstring_view const& value);

inline void* detach_abi(std::wchar_t const * const value);

template <typename T>
std::pair<uint32_t, void*> detach_abi(winrt::com_array<T>& object) noexcept;

template <typename T>
std::pair<uint32_t, void*> detach_abi(winrt::com_array<T>&& object) noexcept;

Parameter

object Objek C++/WinRT untuk dioperasikan.

Mengembalikan nilai

Handel, atau penunjuk ke antarmuka mentah, yang dirujuk oleh objek C++/WinRT.

Persyaratan

SDK minimum yang didukung: Windows SDK versi 10.0.17134.0 (Windows 10, versi 1803)

Namespace: winrt

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

Lihat juga