Hello!
I have a problem with a COM component.
I have a function that returns a BSTR.
It works very well when the string is about
22KB and smaller (that is what I have tested).
But in one case the string is as big as 12MB,
then the code crash in line 3 below, can
anybody explain why? is there a max size for
BSTR/_bstr_t?

1. STDMETHODIMP X::Func(BSTR * result)
2. {
3. _bstr_t bstrBuf((char*)data->OutputBuf);
4. *result = bstrBuf.copy();
5. return S_OK;
6. }


Thanks and regards
Rikard