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 に答える