printf() functions support Unicode input via WideString strBSTR // <- WideString is a wrapper for BSTR, manages the There are several different ways you can display the BSTR, eg: Is why you only see the first character - it prints the first byte of theįirst character, and then stops on the second byte because it is 0. Treating the BSTR as a null-terminated Ansi string, which it is not, that For ASCII characters,Ĭharacters still take 2 bytes each, but the second byte will be 0. That is because BSTR uses UTF-16 as its character encoding. > This shows only first char of the BSTR string > Here are some related pages if u have similar but different problem: > sprintf(str,"string: %s", (char*) (strBSTR)) > getBSTR(&strBSTR) // a special method to retrive BSTR of something > How do we convert fast as shown here ? This shows only first char of the ![]() > Hello there are many pages about BSTR conversion but mostly based on MS wrote in message Easy question needs fast reply :) Sprintf(str,"string: %s", AnsiString(WideString(strBSTR)).c_str()) You haven't said what version(s) you're using, but the following might work
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |