|
-
October 25th, 2001, 03:22 AM
#1
Max size for BSTR?
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
-
October 25th, 2001, 07:22 AM
#2
Re: Max size for BSTR?
It could so be that the OS is not able to allocate that much memory for the string.
There is no upper limit to the length of a BSTR or any string for that matter. The only constraint on the length of the BSTR is the available memory.
Please correct me if I'm wrong.
Regards,
The Beret.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|