About CComboBox::GetLBText()
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I created about 40 CComboBox dynamically, and do following process for every combobox
-----------------------------------------------------------------
pComboBox[i]->AddString(str); //line 1
int iCurIndex = pComboBox[i]->SelectString( -1, str); //line 2
if(iCurIndex != -1)
pComboBox[i]->GetLBText(iCurIndex , str); //line 3When i is 36, exception will occur at line 3. At this time, iCurIndex is 0, however,content of pComboBox[36] can't be acquired.
-
I created about 40 CComboBox dynamically, and do following process for every combobox
-----------------------------------------------------------------
pComboBox[i]->AddString(str); //line 1
int iCurIndex = pComboBox[i]->SelectString( -1, str); //line 2
if(iCurIndex != -1)
pComboBox[i]->GetLBText(iCurIndex , str); //line 3When i is 36, exception will occur at line 3. At this time, iCurIndex is 0, however,content of pComboBox[36] can't be acquired.
When i is 36, only pComboBox[0] to pComboBox[35] is valid. So pComboBox[36] is invalid.
«_Superman_»