[英]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.