Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting CListCtrl items before control is displayed

Status
Not open for further replies.

gmgarrison

Programmer
Sep 26, 2000
11
0
0
US

I have a dialog with a list control on it and I'd like to add a button that would bring up another dialog with a second list control which would display only the selected items from the first dialog. Every time I try to access the control variable of the second list control, however, I get a debug assertion that fails because it's not a window.

My question is simply how can I manipulate data in the list control that's not displayed?

Thanks in advance for any help...
 
All that I see from your question is that u need to somehow pass the data from the first dialog to the second. Think of passing the data from the first during the creation of the second (thru constructor). Something like...

// First dialog cpp file
CSecondDialog dlg (data1, data2);

In your CSecondDialog.h/cpp files update the function declaration/definition of the constructor to include these 2 new data parameters.

You now have the data in the constructor. Just go ahead and assign these values to any member variables declared in your second dialog.

Hope this helps.
Sriks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top