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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String To BSTR?

Status
Not open for further replies.

Sidro

MIS
Sep 28, 2002
197
US
HI,
I would like to know how to convert a string type to a BSTR string type,the type Visual basic uses. Does anyone know how or done this before.Thanks a bunch!
 
Hallo,

Have you done an Advanced Search in this forum for BSTR?
There seems to be a lot there, but I'm no expert,

- Frink
 
It depends on the type of string you've already got.
If it's already a WCHAR then SysAllocString(string) will do the trick for you. If not, you've got to convert it to an OLECHAR (WCHAR) first, with for instance the MultiByte2WideChar API (can't remember the name exactly, but something like that).
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top