BSTR,TCHAR,WCHAR,CHAR,CComVariant,CComBSTR,SysAllocString, SysFrssString在哪定义,是怎么定义的,定义是什么样的?

解决方案 »

  1.   

    // BSTR
    是一个指针,指向宽字符字符串,typedef OLECHAR *BSTR;
    //TCHAR
    The TCHAR data type is a Win32 character string that can be used to describe ANSI, DBCS, or Unicode strings. For ANSI and DBCS platforms, TCHAR is defined as follows:
    typedef char          TCHAR;    
    For Unicode platforms, TCHAR is defined as synonymous with the WCHAR type. 
    // WCHAR
     16-bit Unicode character. 
    // CHAR
    8-bit Windows (ANSI) character.
    // CComVariant
    对VARIANT进行了封装
    // CComBSTR
    对BSTR进行了封装
    // SysAllocString和SysFreeString
    Win32 api function, 
    SysAllocString是分配一个字符串,并copy the passed string into it.
    SysFreeString是释放由SysAllocString分配的内存空间