Again CListBox
-
Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!
-
Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!
hanno25 wrote:
the program returns a error message
What message? The message that you get is telling you what is wrong. If you want help you have to let us know what the message is or else all we can do is take a guess. My guess is that the CListBox window is not yet created when you call AddString() so there is no HWND to handle the LB_ADDSTRING message, resulting in an ASSERTion being thrown in CListBox::AddString().
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!
-
Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!
-
Another question: Before calling the dialog, I try to call another function, which has access to the list elements. This function should fill the CListBox. But every time, I will add this elements to the CListBox (using AddString("text")), the program returns a error message. Whats the mistake? Help!
you may add ur code into initdialog function that insert the elements into the list box BOOL CTestDlg::OnInitDialog() { CDialog::OnInitDialog(); //my code for adding the data into listbox } Thanks and Regards Laxman FAILURE is the first step towards SUCCESS :cool: