Re: How to change a CDialog's template after creation
I think this would be difficult since the resource compiler really changes
the template into a resource at compile time. You could add to the dialog
after it is created or, I guess, modify the resource after it's read from
the EXE, but if you did this after the dialog had been constructed you
wouldn't see the changes.
It might be easier to do one of these things:
1. Add controls dynamically that you need:
http://www.codeproject.com/dialog/dynamicdialog.asp?df=100&forumid=330&exp=0&select=1008804
2. Have more than one dialog template and load the one you want at runtime.
You can change the ID and as long as all of the controls are there (I.E.,
you don't want to get bombed out in DDX for not having a control available)
you could swap the IDD's at runtime to create the version you really want.
If you don't need to see some of the controls on one version you could hide
them and just make them really small on the bottom of the dialog or
something like that.
Tom
"ben" <brm@morrisb.fsnet.co.uk> wrote in message
news:1155216390.877590.213200@q16g2000cwq.googlegroups.com...
Hi All,
DialogBoxIndirect() supports the creation of dialogs based on an in
memory template (DLTEMPLATE struct) that describes the dialog and it's
associated controls but is it possible to change a dialog's template
(DLGTEMPLATE) after it has been constructed i.e. after
DialogBoxIndirect() has been called? If so how?
Many thanks in advance,
Ben.