发送通知消息给父母 [英] Send a notification message to the parent

查看:146
本文介绍了发送通知消息给父母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在CRecordView父视图上发生CEdit控件和CDateTimeCtrl控件更改事件时使用哪个功能之一:

BOOL CMyView::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CRecordView::OnChildNotify(message, wParam, lParam, pLResult);
}



BOOL CMyView::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CRecordView::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}



BOOL CMyView::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CRecordView::OnCommand(wParam, lParam);
}



BOOL CMyView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CRecordView::OnNotify(wParam, lParam, pResult);
}



当某些CEdit控件上发生更改事件时,我正在使用相同的代码,因此最好的解决方案是使用上述功能之一,但我不知道它们之间的区别(哪种情况适合这种情况?)

我也有一些CDateTimeCtrl控件

请帮我:((

解决方案

根据 解决方案

According to the documentation on EN_CHANGE[^], it''s sent as a command message. There is a special message map handler for edit control changes, ON_EN_CHANGE, which accepts a afx_msg void OnChangeMyEdit(); handler method.


这篇关于发送通知消息给父母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆