winstd::com_obj "QueryInterface" constructors added

This commit is contained in:
Simon Rozman 2017-04-24 21:07:39 +02:00
parent e9abc0e7b6
commit 79b9ac4371

View File

@ -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 <class _Other>
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 <class _Other>
inline com_obj(_Out_ com_obj<_Other> &other)
{
assert(other);
other->QueryInterface(__uuidof(T), (void**)&m_h);
}
///
/// Releases object
///