Understanding Strings In COM[6]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 edyang 的 blog

operator>=(const _bstr_t& str) const throw();

 
                    // low-level helper functions
                    //
                    bstr copy() const throw(_com_error);
                    unsigned int length() const throw();
 
private:
                    // [...private stuff omitted...]
}

continued...

copyright © 1999 - visual c++ developers journal

 


frameworks and conversions

your ideas of olechar and bstr and your understanding of the manner com handles strings should be much clearer now, but we still have to cope with type conversions to and from these somewhat special data types and the more traditional tchar, wchar and char.

atl and mfc both use the same group of macros to deal with string conversions. these macros' names follow a precise convention: the characters before the "2" indicate the original type of the variable to convert, and the characters after the "2" indicate the destination type after the conversion. the following table lists the valid symbols in a conversion macro name:

short name

data type

a

lpstr, char*

ole

lpolestr

t

lptstr, tchar*

本文关键:Understanding Strings In COM
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top