In case of char* pointer we check whether it is NULL before using it.
Is there a similar error checking mechanism for BSTR?
I tried checking the lenght, but this is not the rightway, it hangs.
I am using ATL, my function get called by ExOLEDB.
Thanks
Ramesh
Ramesh,
You can certainly check the BSTR for NULL. Other than that, it really
depends on what your function expects. For instance, you might not
allow an empty BSTR, so you could check the length using the
SysStringLen API.
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
There's possibly an API to check whether the pointer passed in does point to
the start of a validly allocated COM memory block (one allocated, directly
or indirectly, with CoTaskMemAlloc), but I don't know of it. The API
IsValidPtrIn would seem like a good candidate, but is just marked as being
obsolete (and if it's available at all on your platform then it probably
just always returns true).
S.
"Ramesh" <asno...@hotmail.com> wrote in message
news:45ad1436.0402...@posting.google.com...
Regards,
Ramesh
"Simon Trew" <ten.egnaro@werts> wrote in message news:<e9CIJj2$DHA....@TK2MSFTNGP11.phx.gbl>...