Re: CDialog & CComboBox init
Create a memeber variable in your dialog class and set it to the selection you want, then in OninitDialog call SetCurSel. You are calling SetCurSel before DoModal which means the physical dialog does not exist yet, resulting in a crash.
HTH,
Chris
Re: CDialog & CComboBox init
How come I can set any other CEdit-controls of this dialog, heck, I can even set the VALUE
of the CComboBox (if I use a value-member-variable instead of a control-variable for the
CComboBox) to any value I want and it doesn't crash (but I want to use an item added via
resource-editor).
Is it because the items of this box aren't existing before calling DoModal(), but the ComboBox
itself exists? Don't ask, but I don't want to use OnInitDialog for some reason. I want to set the
initial value of CComboBox (which has items added via resource-editor!) in the function, which
creates the dialog and does the DoModal()... any chance?
Thanks!
-.-.-