I am writing an ATL library (I'm very new at this) and I have a function that I want to return BSTR
and VARIANT_BOOL
. My function looks like this:
STDMETHODIMP myClass::GetResult(BSTR* myString, VARIANT_BOOL* contains) {
std::pair<BSTR, bool> result = outQ.deQ();
CComBSTR stringOut(result.first);
CComVariant cont(result.second);
*myString= stringOut.Detach();
// this doesn't work, and I honestly don't know how to make it work
//*contains = cont.Detach(contains);
return S_OK;
}
I want to call this function from C# code. I had function working like this only with the BSTR
and the C# code got the correct values and all. I just don't know how to return VARIANT_BOOL
because there is no CComVariant_BOOL
or whatsoever.
Any thoughts?