What is the difference between BSTR and WCHR?

Source: Internet
Author: User
BSTR is an ASCII array of characters before "abcdefg \ 0.
Char is a character, and each of the above is a char
Wchar is a wide char, which is a wide character. As the name suggests, the Unicode encoding of the characters stored in two char spaces. This encoding... I cannot give an example. Do not remember ~ Top

2nd floor Enochshen ( Little madman: really good food-shame and courage! ) Reply 23:54:50 Score 0 WCHR is wchar_t BSTR is wchar_t *, char is Char

Wchar_t is the wide character type for Unicode. Double-character representation. The Chinese character is a double-character.

You can use the multibytetowidechar/widechartomultibyte of WIN32API or the mbstowcs/wcstombs series functions of the C Runtime Library to convert top between wchar_t * and char *.

Third floor Masterz ( Www.fruitfruit.com ) Reply 00:08:48 Score 0 Bstrs are wide, double-byte (UNICODE) strings on 32-bit Windows platforms and narrow, single-byte strings on the Apple powermac.
BSTR can only be managed using sysallocstring/sysfreestring,
Wchar_t * can be managed through new/Delete.
Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/automat/htm/chap7_5alv.asp
BSTR itself stores the length of a string: The length is stored as a 32-bit integer at the memory location preceding the data in the string.
Top

4th floor Cn2000 ( Cainiao 2000 ) Reply 21:55:28 Score 0 Up... top

5th floor Cn2000 ( Cainiao 2000 ) Reply 10:39:42 Score 0 There is another problem:
Tchar szbuffer [512];
Wsprintf (szbuffer, _ T ("errord "));
Sysallocstring (szbuffer );
The last line cannot be translated.
Error c2664: 'sysallocstring': cannot convert parameter 1 from 'Char [512] 'to 'const unsigned short *'
Top

Related Questions

    • What is the difference between BSTR and WCHR?
    • "BSTR" when writing com with BSTR: Undeclared identifier. What should I include?
    • What is the difference between full-text search and fuzzy search?
    • ProgramWhen something goes wrong elsewhere, the experts come in and see what else to pay attention.
    • _ Bstr_t why does bstrtxt Report "_ bstr_t": an undeclared identifier?
    • Is there any way to find out where the memory leakage (outofmemory) occurs?
    • What is J2EE j2_based? What is the difference?
    • What is the difference between VC ++ and VC ++ 6.0 in visual studio.net?
    • I only know about struts and ask what other frameworks are there, spring and webwork... what are the differences?
    • What is the difference between element and node in XML, and how can they be converted?

Website introduction-advertisement service-website map-help information-contact info-English-problem report

Csdn Beijing Bailian meide Digital Technology Co., Ltd. Copyright All Rights Reserved: Beijing ICP Certificate No. 020026 csdn

2000-04, csdn. net, All Rights Reserved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.