Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a BSTR is empty

I have a variant that contains a BSTR, but sometimes the BSTR is "" (empty), so how to avoid this? I have tried something like:

variant.bstrVal != NULL

But it didn't work.

like image 292
daiyue Avatar asked Sep 13 '11 21:09

daiyue


1 Answers

Use SysStringLen:

if (SysStringLen(variant.bstrVal) == 0)
{ ... }
like image 101
Sergey Sirotkin Avatar answered Sep 28 '22 00:09

Sergey Sirotkin