Click to See Complete Forum and Search --> : Convert int to BSTR


zhangwei
June 28th, 1999, 01:47 AM
Hi,all
Who know how can convert several int to BSTR?
Thanks very much!

Jason Teagle
June 28th, 1999, 01:59 AM
If you want a BSTR representation of a number (as opposed to a char * representation), do this:

---BSTR bstrNumber ;
CString strNumber ;

sprintf(strNumber.GetBuffer(32),"%d", iMyNumber);
strNumber.ReleaseBuffer(); // Must do this!

bstrNumber = strNumber.AllocSysString();




---

Does this help?