Results 1 to 4 of 4

Thread: Type conversion

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    UK
    Posts
    18

    Question Type conversion

    What is the easiest way to convert a BSTR to a CString?

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    You can easily conver BSTR to CString and backwards
    Code:
    BSTR bstr;
    CString str = (LPCWSTR)bstr;

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Backwards:
    Code:
    CString str("Hello there!");
    BSTR bstr = str.SysAllocString();
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    UK
    Posts
    18
    Thanks.

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