#pragma once #include #include namespace MFUtils { template using TComPtr = Microsoft::WRL::ComPtr<_Ty>; template inline TComPtr<_Ty> MakeComInstance() { TComPtr<_Ty> obj; _Ty** ppv = &obj; *ppv = new _Ty(); return obj; } template inline TComPtr<_Ty> ReferencedPtrToComPtr(_Ty* ptr) { TComPtr<_Ty> obj; _Ty** ppv = &obj; *ppv = ptr; return obj; } } // namespace MFUtils