How to compare two BSTRs or CComBSTRs?
问题 What is the right way to compare two CComBSTRs? I tried to use bool operator ==( const CComBSTR& bstrSrc ) const throw( ); However it always return false even two ComBSTRs are the same. It did not work correctly. Do I have to convert CComBSTRs to ANSI string first and then use strcmp? Thanks! -bc 回答1: You should probably use VarBstrCmp. EDIT: this is actually what CComBSTR::operator== does, so without further context, your code may be incorrect. 回答2: BSTRs (and therefore CComBSTRs) are