MFC UpdateAllViews是阻止还是非阻止? [英] Is MFC UpdateAllViews blocking or non blocking?

查看:87
本文介绍了MFC UpdateAllViews是阻止还是非阻止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于Document View框架的MFC代码.我使用Document类中的UpdateAllViews(nullptr,0,nullptr)来调用View的OnDraw成员函数.

I have a MFC code based on Document View framework. I use UpdateAllViews(nullptr,0,nullptr) from Document class to invoke the View's OnDraw member function.

void MyDocumentClass::MyFunction()
{
    //.. Document code to create and process data
    UpdateAllViews(nullptr,0,nullptr) // Invokes OnDraw
    // When does program control reach this line? 
}

我的问题是,请告诉我UpdateAllViews函数是阻塞还是非阻塞,程序控制何时到达UpdateAllViews()旁边的行?它是在OnDraw()中的所有代码完成执行之后到达那里的,还是更快到达那里?

My question is, please tell me if the UpdateAllViews function is blocking or non blocking, when does program control reach the line next to UpdateAllViews()? Does it reach there after all the code in OnDraw() has finished executing, or does it reach there sooner?

推荐答案

UpdateAllViews是一个非阻塞函数,它仅调用每个视图的OnUpdate. OnUpdate函数通常会使视图无效,这将在以后导致OnDraw. UpdateAllViews在无效之后和绘画之前返回.

UpdateAllViews is a nonblocking function that simply calls OnUpdate of each view. The OnUpdate function typically invalidates the view, which will cause OnDraw later. UpdateAllViews returns after the invalidating and before the painting.

这篇关于MFC UpdateAllViews是阻止还是非阻止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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