25 #ifndef INCLUDED_PropertyBagHelper_h_GUID_BAA9AA5B_2879_4CA0_04F3_9B90F3BAC871 26 #define INCLUDED_PropertyBagHelper_h_GUID_BAA9AA5B_2879_4CA0_04F3_9B90F3BAC871 44 mon.BindToStorage(
nullptr,
nullptr, IID_IPropertyBag,
45 AttachPtr(m_propBag));
49 explicit operator bool()
const {
return bool(m_propBag); }
58 std::wstring
read(
const wchar_t propName[])
const {
59 using namespace comutils::variant;
61 auto ret = std::wstring{};
63 m_propBag->Read(propName, AttachVariant(val),
nullptr);
64 if (contains<std::wstring>(val)) {
65 ret = get<std::wstring>(val);
73 #endif // INCLUDED_PropertyBagHelper_h_GUID_BAA9AA5B_2879_4CA0_04F3_9B90F3BAC871 Header with a template alias for the desired COM smart pointer.
Assists in retrieving string properties from a property bag associated with a moniker.
Definition: PropertyBagHelper.h:41
Header defining a wrapper for COM's VARIANT type.
IPropertyBag & getPropertyBag()
Accessor for underlying object reference.
Definition: PropertyBagHelper.h:52
boost::intrusive_ptr< T > Ptr
Template alias for our desired COM smart pointer.
Definition: ComPtr.h:40
IPropertyBag const & getPropertyBag() const
Const accessor for underlying object reference.
Definition: PropertyBagHelper.h:55
std::wstring read(const wchar_t propName[]) const
Reads a (wide-string) property, returning an empty string if failed.
Definition: PropertyBagHelper.h:58