Link to home
Start Free TrialLog in
Avatar of winkle
winkle

asked on

Create vs DoModal for CDialog w/ controls created on the fly

I have a situation where I create a window with a number of buttons on it. The number and label of these buttons are unknown at dialog creation time. What I do now is Create() the dialog window and call ShowWindow() once everthing has been created. On cancel and okay the dialog window is destroyed (I tried using hide if okay was clicked and the program crashed. I'm ignoring htis point right now because I haven't gone back through and tried it again no that the program is stable. Point is I did try the hide/show method). This functions just fine, however, I'm not sure what this is doing to memory. What I'm wondering is if there is a way to create a window with DoModal and create child controls before the dialog is shown.

THanks

ps. I'm using MFC DevStudio Visual C++ version 5.0
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial