0

Hi,
I did a program which is dialog based application,in that i add listbox dynamically by deriving a class form CListBox class.and the list box is created in OnInitDialog() method.but when i add the listbox to the dialog using DDX_Control function it is failed to assert the listbox,because 3rd parameter is not initialized which is null.so, i need to initialize the list box before dialog gets intialized.
so, this is is done in precreatewindow() . but i am not able to call this function.it never execute.
can any one help me , can we call precreatewindow() function from the CDialog class?
if, No what is the exact reason?
thanks in advance..

2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by thammalatha
0

You are probably trying to create the list box before the dialog box is created. Move the code to just before the return statement in OnInitDialog() as shown here.

0

thnaks u but what happen when i write that code into oncreate() method?

thanks in advance

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.