Re: Ali R Can you guide me in this problem ??
1.Why this is a bad design as I am delegating some of the work to take
care by itself rather than parent window?Is this not modularity ?
This is really not that bad of a design. It could cause some headache later
if you try to set data to other controls on the dialog when the user changes
selection in the list control. Then you will have to pass more and more
controls to your new list control.
If it was me, I would still catch the selection change in the parent dialog,
but would call a function in List control to populate the second list
control, and pass it the pointer to the list control that it would have to
populate. Something like this
void CMyDialog::OnListCtrlNMClick()
{
m_ListCtrl.Populate(m_SecondListCtrl);
}
void CMyListCtrl::Populate(CListCtrl &ListCtrl)
{
//make sure it is created
ASSERT(ListCtrl.IsWindow());
//if the report has to be in a specific mode, then
//make sure it is in that mode
ASSERT(ListCtrl.GetStyle() & LVS_REPORT == LVS_REPORT);
//now populate the control
}
3.Handling of messages in a child window is Reflection . Will
Refelection make things worser ? What othe problems will this approach
face in future ?As I see only the handle to pass for manipulation?
You won't have any problems as long as you are using ON_NOTIFY_REFELECT_EX.
That way the parent window will also get the notification of the message.
AliR.