Removing text from ComboBoxText



Hello list,

So i am trying to remove text from a comboboxtext when a user clicks a button. However, i get "basic_string::_M_construct null not valid" and in some cases an std::bad_alloc. I can't understand what i am doing wrong.
Sometimes it works just fine, but when i restart my application and try again it fails !
The following code is in a callback function linked to a button :
// Code of callback

string nom = posteCfgcombo->get_active_text();

int index = posteCfgcombo->get_active_row_number();

posteCfgcombo->remove_text(index);

posteCfgcombo->unset_active();

// end

Can anyone point out what am i doing wrong here ?

Thanks.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]