ClistBox problem here........help!!!!! :-(
-
Run this by me... Im missing something and i cant see what. Ok, Supposing i have a PropertySheet. inside it i have a CPropertyPage Class that has 'CListBox myListBox' as a class member variable and is attached to a ListBox control created using the resource editor. I then have another class called myApp derived from CWinApp. The question is... How do i add a string to my ListBox contol at runime from a function triggered by another action in myApp? When i put the pieces together and compile its all fine until trgger the function. From then i get an assertion error. void signature(){ cout<<"Sobbayi Interactive"<
-
Run this by me... Im missing something and i cant see what. Ok, Supposing i have a PropertySheet. inside it i have a CPropertyPage Class that has 'CListBox myListBox' as a class member variable and is attached to a ListBox control created using the resource editor. I then have another class called myApp derived from CWinApp. The question is... How do i add a string to my ListBox contol at runime from a function triggered by another action in myApp? When i put the pieces together and compile its all fine until trgger the function. From then i get an assertion error. void signature(){ cout<<"Sobbayi Interactive"<
You are supposed to write:
myApp.myListBox.InsertString("My String 1");
Am I right ? ;)
MaestroProgramador.Com Where every source code is loved like a girl.
-
Run this by me... Im missing something and i cant see what. Ok, Supposing i have a PropertySheet. inside it i have a CPropertyPage Class that has 'CListBox myListBox' as a class member variable and is attached to a ListBox control created using the resource editor. I then have another class called myApp derived from CWinApp. The question is... How do i add a string to my ListBox contol at runime from a function triggered by another action in myApp? When i put the pieces together and compile its all fine until trgger the function. From then i get an assertion error. void signature(){ cout<<"Sobbayi Interactive"<
You're probably trying to write to a non-existing listbox. You have to pass the listbox along to the other class in order to write to it. Create a pointer to the listbox in the myApp class and then set it equal to the listbox when you set up the myApp class, then you should be able to write to it. Mike
-
You're probably trying to write to a non-existing listbox. You have to pass the listbox along to the other class in order to write to it. Create a pointer to the listbox in the myApp class and then set it equal to the listbox when you set up the myApp class, then you should be able to write to it. Mike
Thanks guys, The problem is certainly not InsertString() or AddString() i think i am gonna go with Mike. I discovered i am actually trying to insert a string into a non initialized ListBox. So am gonna go with using a pointer to myListBox from myApp class. Thanks alot guys. void signature(){ cout<<"Sobbayi Interactive"<