i cannot add an item to my list box that is located within my dialog box 
Author Message
 i cannot add an item to my list box that is located within my dialog box

i have Visual C++ starter kit 2.0, that is the working version. i am trying
to create a list box for a dialog box i created, but it gives me an
assertion error. i had a program where i created a list box on the main view
form and that worked. In the current prgram in which i have my list box
created in the dialog box i used the syntax statement:
dlg.listbox.AddString("Item");
In the other other program that does work with the list box the syntax
statement is: listbox.AddString("item");
what am i doing wrong to get that assertion error?
I am so sure that the where i have the statement it is correct, i am
wondering if it has anything to do with the fact that i am using a working
version and not a full version.
please help me!


Sun, 21 Oct 2001 03:00:00 GMT  
 i cannot add an item to my list box that is located within my dialog box

Quote:

> i have visual c++ starter kit 2.0, that is the working version. i am trying
> to create a list box for a dialog box i created, but it gives me an
> assertion error. i had a program where i created a list box on the main view
> form and that worked. In the current prgram in which i have my list box
> created in the dialog box i used the syntax statement:
> dlg.listbox.AddString("Item");
> In the other other program that does work with the list box the syntax
> statement is: listbox.AddString("item");
> what am i doing wrong to get that assertion error?
> I am so sure that the where i have the statement it is correct, i am
> wondering if it has anything to do with the fact that i am using a working
> version and not a full version.
> please help me!

dlg.listbox.AddString("Item");

This line can't work if it comes before DoModal, because before DoModal the Windows structures and HWND for the dialog and list box do not yet exist.  Move creation and initialization of dialog children into OnInitDialog, which is called after the dialog and control windows are actually created.



Sun, 21 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Disabling editing of list box items in the file open dialog box

2. List Box - Add item does option does not exist as in VB.

3. Cannot add an ActiveX control to a DLL dialog box

4. Cannot add an ActiveX control to a DLL dialog box

5. Add Combo Box to Dialog Box

6. Add a combo box in a dialog box...

7. List boxes in Modal Dialog Box

8. Problems with List box in dynamically created dialog box

9. Problems with List box in dynamically created dialog box

10. Transfer of data from an edit box in one dialog box to a list box in another dialog box II

11. Modeless dialog box together with modal dialog box

12. activating a button on a dialog box from a dialog box

 

 
Powered by phpBB® Forum Software