winrt::attach_abi 函式 (C++/WinRT)

C++/WinRT 物件附加至控制碼的協助程式函式,或附加至擁有其目標參考的原始指標。 在指標的情況下,不會加入其他參考。 如有需要,您可以使用此函式來聯合參考。 如需詳細資訊和程式碼範例,請參閱 C++/WinRT 與 ABI 之間的 Interop

語法

template <typename T>
void attach_abi(com_ptr<T>& object, winrt::impl::abi_t<T>* value) noexcept;

void attach_abi(winrt::hstring& object, void* value) noexcept;

void attach_abi(winrt::Windows::Foundation::IUnknown& object, void* value) noexcept;

參數

object 要運作的 C++/WinRT 物件。

value 控制碼,或擁有其目標參考的原始指標。

規格需求

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

命名空間: winrt

標頭: %WindowsSdkDir%IncludeWindowsTargetPlatformVersion <> \cppwinrt\winrt\base.h 預設包含 ()

另請參閱