BSTR variable
-
Hi Can you please tell me...what is the wrong in the following code snippet . BSTR abc; abc is having some data in it. Now I need to check whether abc is having empty string. for that I wrote the code like this if( abc ==L"") AfxMessageBox("empty string"); But I receive a compilation error ; Please help me to ressolve the issue. Thanks in advance.
-
Hi Can you please tell me...what is the wrong in the following code snippet . BSTR abc; abc is having some data in it. Now I need to check whether abc is having empty string. for that I wrote the code like this if( abc ==L"") AfxMessageBox("empty string"); But I receive a compilation error ; Please help me to ressolve the issue. Thanks in advance.
-
Hi Can you please tell me...what is the wrong in the following code snippet . BSTR abc; abc is having some data in it. Now I need to check whether abc is having empty string. for that I wrote the code like this if( abc ==L"") AfxMessageBox("empty string"); But I receive a compilation error ; Please help me to ressolve the issue. Thanks in advance.
you may use
if ( wcscmp(abc,L"") == 0)
AfxMessageBox("empty string");or, if you want to use the equality operator, choose to encapsulate the
BSTR
data inside a_bstr_t
object. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke