winrt::detach_abi, fonction (C++/WinRT)

Fonction d’assistance qui détache un objet C++/WinRT de son handle référencé ou de son interface référencée. Le détachement d’une interface est effectué sans décrémenter le nombre de références, peut-être pour le renvoyer à un appelant. Pour plus d’informations et des exemples de code, consultez Interop entre C++/WinRT et ABI.

Syntaxe

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;

Paramètres

object Objet C++/WinRT à utiliser.

Valeur retournée

Handle, ou pointeur vers l’interface brute, référencé par l’objet C++/WinRT.

Spécifications

Kit de développement logiciel (SDK) pris en charge minimum : Windows SDK version 10.0.0.17134.0 (Windows 10, version 1803)

Espace de noms : winrt

En-tête : %WindowsSdkDir%IncludeWindowsTargetPlatformVersion<>\cppwinrt\winrt\base.h (inclus par défaut)

Voir aussi