The last line:
elementt->ListOfSC[NoOfSC].SC_Label=str;
...produces an assertion error.
Well, I can change one character of the name of the selected item, but when I try to change the second one, I get the assertion error.

I have exactly the same code with a text field, and I dont get any error at all, so I think my problem has something to do with the combobox itself. Can somebody help me?

More detailed explanation of my problem:
Suppose you have a combobox with 3 values:
Hello1
Hello2
Hello3

I implement the OnEditChangeSc method as described above.

I try to change the first element from Hello1 to Hello11. No problem.
Now I try to change Hello11 to Hello111: I get a problem because the
..GetCurSel() method of the combobox returns -1.

But:
I try to change the first element from Hello1 to Hello11. No problem.
Now I change the selected item to Hello2, for instance, and back to Hello11,
which has already been changed. Now I try to change from Hello11 to Hello111.
No problem!
So, if I do something between the changes, I can so many changes as I need,
otherwise, I get the error at the second change, because .GetCurSel is unable
to find the selected item.

I think selection of combobox's list box is removed if combobox's edit box contains text which isn't in the combobox, so changing text 'Hello1' to 'Hello11' removes selection and next GetCurSel() returns -1, which indicates that no item is selected. So you have three possibilities: 1. Add the new string to the combobox or 2. replace the old string with the new one or 3. store the selected string when first change occurs and re-use for further changes.

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

void CHistoryComboBox::SetText(CString strText)
{
// must have a control and a non empty string
if (GetSafeHwnd() && ! strText.IsEmpty()) {
// find existing strText (exact match)
int isel = FindStringExact(-1,strText);
// if not at the top
if (isel != 0) {
// delete old one, if any
if (isel != CB_ERR) {
DeleteString(isel);
}
// insert new one at the top
InsertString(0, strText);
// remove old ones from the end
LimitHistory();
}
// set selection to top of history
SetCurSel(0);
// put the text in the edit box
SetWindowText(strText);
}
}

void CHistoryComboBox::Select()
{
// get the value from the edit box
CString strText = GetText();
if (! strText.IsEmpty()) {
// add it to the history
SetText(strText);
// call virtual for value selected
OnSelected();
}
// act like we just arrived here
OnSetfocus();
}

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008. These same feature are in the MFC libraries that come with Visual …

Introduction:
Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers). Error trapping with try..catch to help the code run even if something goes wrong.
Continuing from the seve…

Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…