I have a CMDIChildWnd containing a CReportView (child) within a CFormView (parent). The CMDIChildWnd also has a toolbar which sends ON_UPDATE_COMMAND_UI to it's child view. That works so far. Now, whenever the CReportView is activated (e.g. clicking on it), the ON_UPDATE_COMMAND_UI messages arrive at the CReportView, not the parent CFormView.
What I want to do now is catching the ON_UPDATE_COMMAND_UI messages in the child view and relay them to the parent view somehow. I tried overriding the CWnd::PreTranslateMessage() method and calling the parent view's SendMessage() method, but the ON_UPDATE_COMMAND_UI didn't arrive there.
I also tried the following
BEGIN_MESSAGE_MAP(CUntisSimpleGrid, CReportView)
ON_MESSAGE(WM_IDLEUPDATECMDUI, OnIdleUpdate)
END_MESSAGE_MAP()
LRESULT CUntisSimpleGrid::OnIdleUpdate(WPARAM wParam, LPARAM lParam)
{
CWnd *pParentView = GetParent();
UpdateDialogControls(pParentView, FALSE);
return 0L;
}
But that didn't work either. Does anyone have an idea?