Locien
09-05-2013 16:56:35
For some reason I can't get MyGUI to compare its strings properly with the == and != operators.
Basically this is a function that adds text to a read only text field from an input field, like a text box of an online game. I can't get it to skip this code in any way. I've also tried to cast it as:
But it doesn't help.
This is what it looks like:

What am I supposed to do to get string comparison to work? Do I have to cast it to an std::string or convert it to a const char*?
if(mChatInputText->getText(0,1) != "/")
{
mChatTextHistory->addText(mChatInputText->getText(0,1)); //Adds text to the read only box.
mChatTextHistory->addText("\n");
mChatInputText->eraseText(0, mChatInputText->getTextLength()); //Erases the text of the input field.
}
Basically this is a function that adds text to a read only text field from an input field, like a text box of an online game. I can't get it to skip this code in any way. I've also tried to cast it as:
if(mChatInputText->getText(0,1) != (MyGUI::UString)"/")
But it doesn't help.
This is what it looks like:
What am I supposed to do to get string comparison to work? Do I have to cast it to an std::string or convert it to a const char*?