CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Posts
    4

    Convert int to BSTR

    Hi,all
    Who know how can convert several int to BSTR?
    Thanks very much!


  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Convert int to BSTR

    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?




    --
    Jason Teagle
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured