I'm trying to create a dialog at runtime. I have used the DLGTMPL sample as a start. I have gotten it to work with the standard controls, like editcontrol, static text and buttons! But I having trouble with nonstandard control like the DateTimePick control. The reason is of cause that I don't understand what MS is doing in the DemoIt function (that's where they create the dialog and run it)

Are there some easiar way of doing this then what MS has done?

If not how do you create a non-standard control at runtime?

// Anders