简体   繁体   English

错误C2678:“ ==”二进制文件:未找到采用“ CSchemaString”类型的左操作数的运算符(或没有可接受的转换)

[英]error C2678: '==' binary: no operator found which takes a left operand of type 'CSchemaString' (or there is no acceptable conversion)

I am transferring a project from VC++6 to VC++ 2005 , and on compilation I get the following error. 我正在将项目从VC++6转移到VC++ 2005 ,并且在编译时出现以下错误。

error C2678: '==' binary: no operator found which takes a left operand of type 'CSchemaString' (or there is no acceptable conversion) 错误C2678:“ ==”二进制文件:未找到采用“ CSchemaString”类型的左操作数的运算符(或没有可接受的转换)

HERE IS THE CODE; 这里是代码;

CSchemaString References("id");
for(j=0;j<=tpChild.GetUpperBound();j++)
{
    if(References == "id") //error C2678: '==' binary: no operator found which takes a left operand of type 'CSchemaString' (or there is no acceptable conversion)

        References = References + intToString(((Component*)tpChild.GetAt(j))->GetComponentID()) +"_"+ ((Component*)tpChild.GetAt(j))->GetName();
    else
        References = References + " id" + intToString(((Component*)tpChild.GetAt(j))->GetComponentID()) +"_"+((Component*)tpChild.GetAt(j))->GetName();
}
if(References != "id") //si references n'est pas vide
    XComponent.AddPlant_Item_Ref(References);



return XComponent;

} }

Any help is appreciated. 任何帮助表示赞赏。

A CSchemaString isn't a string. CSchemaString不是字符串。 You'd need to do 你需要做

References.ToString() == "id"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误C2678:二进制'==':找不到哪个运算符采用类型的左操作数(或者没有可接受的转换) - error C2678: binary '==' : no operator found which takes a left-hand operand of type (or there is no acceptable conversion) C2678二进制&#39;==&#39;:找不到使用&#39;Card&#39;类型的左操作数的运算符(或者没有可接受的转换) - C2678 binary '==': no operator found which takes a left-hand operand of type 'Card' (or there is no acceptable conversion) 错误1错误C2678:二进制&#39;!=&#39;:未找到采用&#39;std :: ofstream&#39;类型的左操作数的运算符(或没有可接受的转换) - Error 1 error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::ofstream' (or there is no acceptable conversion) 错误 C2678:二进制“=”:未找到采用“const std::string”类型的左操作数的运算符(或没有可接受的转换) - error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const std::string' (or there is no acceptable conversion) 错误C2678:二进制'<<':找不到运算符,它接受类型为'const std :: ofstream'的左手操作数(或者没有可接受的转换) - Error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'const std::ofstream' (or there is no acceptable conversion) 错误C2678:二进制&#39;+&#39;:未找到采用&#39;volatile A&#39;类型的左操作数的运算符(或者没有可接受的转换) - error C2678: binary '+': no operator found which takes a left-hand operand of type 'volatile A' (or there is no acceptable conversion) 错误C2678:二进制&#39;&gt;&gt;&#39;:未找到采用&#39;std :: istream&#39;类型的左操作数的运算符(或没有可接受的转换) - error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream' (or there is no acceptable conversion) 错误C2678:二进制'=':找不到哪个运算符带有'const Recipe'类型的左手操作数(或者没有可接受的转换) - error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const Recipe' (or there is no acceptable conversion) 错误 C2678:找不到采用“const_Ty”类型的左侧操作数的运算符(或没有可接受的转换) - error C2678: no operator found which takes a left-hand operand of type 'const_Ty' (or there is no acceptable conversion) 错误C2678:二进制&#39;&gt;&gt;&#39;:未找到采用&#39;std :: stringstream类型的左操作数的运算符 - error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::stringstream
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM