28 lines
805 B
C++
28 lines
805 B
C++
#pragma once
|
|
|
|
namespace MSO {
|
|
|
|
//! Variantable DispatchDriver
|
|
class VariantableDispatch : public COleDispatchDriver {
|
|
public:
|
|
VariantableDispatch() = default;
|
|
VariantableDispatch(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
|
|
VariantableDispatch(const VariantableDispatch& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
|
|
|
|
public:
|
|
explicit operator LPDISPATCH() {
|
|
return COleDispatchDriver::operator LPDISPATCH();
|
|
}
|
|
explicit operator VARIANT() const noexcept {
|
|
if (this->m_lpDispatch == nullptr) {
|
|
return vtMissing;
|
|
} else {
|
|
return _variant_t(this->m_lpDispatch);
|
|
}
|
|
}
|
|
|
|
bool operator!=(nullptr_t) const noexcept { return m_lpDispatch != nullptr; }
|
|
bool operator==(nullptr_t) const noexcept { return m_lpDispatch == nullptr; }
|
|
};
|
|
|
|
} // namespace MSO
|