Swapnil Gupta
Swapnil Gupta

Reputation: 8941

Convert OLECHAR* to CString in VC++?

How to convert OLECHAR* to CString in VC++ ?

Upvotes: 1

Views: 2577

Answers (1)

Steve Townsend
Steve Townsend

Reputation: 54158

OLECHAR* is the same as BSTR. You can convert to CString like this (sorry about formatting, I have lost the code icon for now).

OLECHAR* value;

BSTR (bstrValue(value));

_bstr_t tmp(bstr, FALSE); //wrap the BSTR

CString cs(static_cast<const char*>(tmp)); //convert it

Upvotes: 2

Related Questions