> VC++ 6.0, Win2K > For some reason a problem is showing up in a dialog box that > didn't seem to be a problem before, so I'm confused. But what > happens now is that there is a CDialog that contains a CComboBox. > In the 'OnInitDialog' function of the dialog, the combo box is > populated using the CComboBox::AddString() function. However, > the combo box isn't a window yet, so it's failing with an > assertion in the AddString function for ::IsWindow(m_hWnd). > > When should AddString() be called, if it can't be called during > OnInitDialog()?
If you are trying to refer to the combo box via a mapped CCombobox variable, be sure to not try using it until after CDialog::OnInitDialog() (i.e., the base class call) is called, since that is where variable / control mappings are hooked together. Trying to call it prior to that will cause the above error. -- Jason Teagle [EMAIL PROTECTED] _______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
