I have a [dual]
interface implementing IDispatch
, something like this:
[dual, ...]
interface IMyInterface : IDispatch
{
[id(1), propget] HRESULT StringValue([out, string, retval] OLECHAR const ** str);
};
My backing object for IMyInterface
has a member variable, d_str
:
class CBackingObject : public IMyInterface
{
std::basic_string<OLECHAR> d_str;
...
};
What's the COM convention for returning StringValue
property? Should I return d_str.data()
, or a copy of it? Do clients automatically take on the responsibility of freeing the string returned by a string-valued property?