0

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

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

这是代码;

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;

}

任何帮助表示赞赏。

4

1 回答 1

4

CSchemaString 不是字符串。你需要做

References.ToString() == "id"
于 2012-07-20T15:00:07.460 回答