gpt4 book ai didi

c++ - 错误 C2678 : '==' binary: no operator found which takes a left operand of type 'CSchemaString' (or there is no acceptable conversion)

转载 作者:行者123 更新时间:2023-11-27 23:22:54 24 4
gpt4 key购买 nike

我正在将项目从 VC++6 转移到 VC++2005,在编译时出现以下错误。

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

这是代码;

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;

感谢任何帮助。

最佳答案

CSchemaString 不是字符串。你需要做的

References.ToString() == "id"

关于c++ - 错误 C2678 : '==' binary: no operator found which takes a left operand of type 'CSchemaString' (or there is no acceptable conversion),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11581828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com