问题描述
我有一个基于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是阻止还是非阻止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!