我终于弄到了我的应用程序中的wxChoice控件,并且由于某种原因,当我尝试修改列的文本时,出现错误:wxChoice :: SetString()索引错误
....\src\msw\choice.cpp(348): assert "IsValid(n)" failed in wxChoice::SetString(): invalid item index in wxChoice::SetString
错误本身使得它很明显,物品索引是无效的,但基于我的代码和(不是很具描述性)documentation,我应该只需要设置列数,然后我会被允许编辑给定索引处的文本。
下面是从我的项目的代码段:
int phones = Phones->size();
choiceDevice->SetColumns(phones); // Value greater than 0
choiceDevice->SetString(phones - 1, pInstance->ProfileName); // Should assign the last index the value of the ProfileName.
我已经检查过,并且我已经尝试设置'choiceDevice-> SetColumns(phones);'到'choiceDevice-> SetColumns(1);'在SetString处有索引0并且仍然没有骰子。 – Lander