UpdateAllViews
void UpdateAllViews( CView* pSender, LPARAM lHint = 0L, CObject* pHint = NULL );
的第二个参数是什么意思?可以传入哪些值,各代表什么?
我查MSDN都没找到。
问题点数:20、回复次数:2Top
1 楼seesi(不是我想骗你,是我不知道怎么才能不骗!)回复于 2001-11-19 12:49:36 得分 0
You can encode information using lHint and/or you can define a CObject-derived class to store information about the modifications and pass an object of that class using pHint.
附加参数Top
2 楼hncdsun(魔)回复于 2001-11-19 13:57:20 得分 20
在MFC中定义如下:
void CDocument::UpdateAllViews(CView* pSender, LPARAM lHint, CObject* pHint)
// walk through all views
{
ASSERT(pSender == NULL || !m_viewList.IsEmpty());
// must have views if sent by one of them
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
ASSERT_VALID(pView);
if (pView != pSender)
pView->OnUpdate(pSender, lHint, pHint);
}
}
void CView::OnUpdate(CView* pSender, LPARAM /*lHint*/, CObject* /*pHint*/)
{
ASSERT(pSender != this);
UNUSED(pSender); // unused in release builds
// invalidate the entire pane, erase background too
Invalidate(TRUE);
}
///////////////////////////////////////////
在自己的VIEW中,规定只重画的区域:由pHint
void CMyView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
if(pHint!=NULL)
{
CRect rect=//pHint;//这里自己去转换
this->InvalidateRect(&rect);
return;
}
Invalidate(TRUE);
return;
}Top
相关问题
- UpdateAllViews()的问题?
- 各位关于UpdateAllViews()
- 一个UpdateAllViews()的问题
- 二级线程调用pDoc->UpdateAllViews(NULL)?
- 谁能详细讲一下UpdateAllViews()的用法。
- 为什么我用UpdateAllViews(NULL)不能更新所有的视图?
- 询问:UpdateAllViews(CView *pSender,LPARAM lHint,CObject *pHint)中如何确定参数lHint?
- 为什么UpdateAllViews会出现ASSERT宏错误呢?在线等,谢谢~~~~~~~~
- CDocument::UpdateAllViews中,我只能跟踪到 invalidate,不知是在什么地方发送消息 WM_PAINT 从而重画窗口?




