Hi,

I have a cheklistbox created in my application. I have created using the CListBox and setting the OwnerDraw as TRUE. I

am adding a few strings to the checklistbox and trying to delete them if they are UNCHECKED.

PROBLEM!!!

But it is not deleteing all the strings and the output is not the predicted one.

The code I am using for deletion is....

////////////////////CODE////////////

CCheckListBox *clb = (CCheckListBox *)GetDlgItem(IDC_PEAKLIST);

int NumofItems;

NumofItems = clb->GetCount();

for (int i=0;i<NumofItems;i++)

{

int Checked;

int num;

Checked = clb->GetCheck(i);

if (Checked == 0)

{

num = clb->DeleteString(i);

if (num = LB_ERR)

AfxMessageBox("Error deleteing string!!"

}

}

////////////////////////////////////////////////////////////

Is it a known bug or a problem?

Please help me to solve the problem.....


Thanks in advance........

Vittal