Convert char * -> bstr

How can i convert a char * into a bstr?
LVL 1
mammouthAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
SysAllocString:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/automat/htm/chap7_8r53.asp

But if you are in Visual C++ you can use:

BSTR str = CString("A char pointer or text").AllocSysString();
0
 
mammouthAuthor Commented:
Here the way i found:       

CComBSTR bStr(Resultchr);
*Result = bStr.Detach();
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.