#pragma once #include #include #include #include template T from_cx(Platform::Object^ from) { T to{ nullptr }; winrt::check_hresult(reinterpret_cast<::IUnknown*>(from) ->QueryInterface(winrt::guid_of(), reinterpret_cast(winrt::put_abi(to)))); return to; } template T^ to_cx(winrt::Windows::Foundation::IUnknown const& from) { return safe_cast(reinterpret_cast(winrt::get_abi(from))); }