我終於弄到了我的應用程序中的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