CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    128

    convert Bstr to char

    how do i convert Bstr to char ?
    please give me an example.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: convert Bstr to char

    Victor Nijegorodov

  3. #3
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: convert Bstr to char

    That's not really easy since a BSTR is a string of multiple wide characters while a char is a single non-wide character. What exactly do you want to do?

    This thread could also be helpful: http://www.codeguru.com/forum/showth...highlight=BSTR
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: convert Bstr to char

    Check out the ATL string conversion macros.

    The link recommends using CComBSTR class and the COLE2T macro.

  5. #5
    Join Date
    Mar 2001
    Posts
    2,529

    Re: convert Bstr to char

    Code:
    char* __stdcall ConvertBSTRToString( BSTR pSrc );
    http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
    ahoodin
    To keep the plot moving, that's why.

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