Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VARIANTS and their typecast

Status
Not open for further replies.

richsb

Technical User
Aug 2, 2001
34
NO
Hi,

Any clues as to what I should be using to change the type of a VARIANT into a CString ?

Cheers
Rich
 
use _varaint_t and _bstr_t. Once you have a _bstr_t you can use the LPCTSTR conversion operator to copy the data into a CString.

Code:
VARIANT v = ....;
_bstr_t bstr(v);
CString str((LPCTSTR)bstr);


-pete
I just can't seem to get back my IntelliSense
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top