1
ComboBoxの各項目にintを割り当てようとしています。ここでWindows API Comboboxデータが挿入されていません
は私のコードです:
int itemIndex = ComboBox_InsertString(hComboBox, -1, strData);
if (itemIndex > -1)
{
// idataIndex is always 0
// and ComboBox_GetItemData() always returns 0 regardless of what intData is
int idataIndex = ComboBox_InsertItemData(hComboBox, itemIndex, intData);
}
私が何か間違ったことをやっていますか?これはかなり簡単です。
EDIT:
はComboBox_InsertItemData
がCB_INSERTSTRING
代わりのCB_SETITEMDATA
を送信し、それを考え出しました。アイテムデータを設定するにはCB_SETITEMDATA
を送信する必要がありました。
intDataはどのように宣言され、設定されていますか? – Chris
@Chris int intData = 20; '、デバッガでチェックして、intDataを設定しました。 – Josh