diff --git a/include/WinStd/COM.h b/include/WinStd/COM.h index e221453d..4fd8d0f4 100644 --- a/include/WinStd/COM.h +++ b/include/WinStd/COM.h @@ -64,6 +64,32 @@ namespace winstd } + /// + /// Queries the object for another interface and creates new class with it + /// + /// \sa [IUnknown::QueryInterface method](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682521.aspx) + /// + template + inline com_obj(_Out_ _Other **other) + { + assert(other); + other->QueryInterface(__uuidof(T), (void**)&m_h); + } + + + /// + /// Queries the object for another interface and creates new class with it + /// + /// \sa [IUnknown::QueryInterface method](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682521.aspx) + /// + template + inline com_obj(_Out_ com_obj<_Other> &other) + { + assert(other); + other->QueryInterface(__uuidof(T), (void**)&m_h); + } + + /// /// Releases object ///