Posted on 2003-10-30
I am having a small problem. I have written a piece of code and want to find what exactly it will react as.
The code is as follows.
BSTR bstr ;
CString str="hello this is a test" ;
bstr = str.AllocSysString() ;
I wanted to show a message box or u can say wanted to extract the data in the BSTR variable without using a _bstr_t or CString avriable.
So i tried this stunt i.e AfxMessageBox((LPCTSTR)(_bstr_t)bstr);
Please tell me if this will work only as a typecast operator , or it will allocate memory for the BSTR to _bstr_t conversion.
Thanks a lot.