What is RunModalLoop / EndModalLoop used for and how do you use it??
Printable View
What is RunModalLoop / EndModalLoop used for and how do you use it??
RunModalLoop is a non-virtual member function of CWnd.
It is called by the CDialog function DoModal (which is virtual.)
EndModalLoop is called to end the loop. Typically, you will
never have to use them. That is, unless you want to write
your own DoModal. If you want to do idle-time processing in
a dialog write an OnKickIdle handler for WM_KICKIDLE.
Check out the MFC source code in wincore.cpp to see the
implementation of RunModalLoop. It is called from dlgcore.cpp
for CDialog and from dlgprop.cpp for a property sheet.
Do you have a use for these that can't be handled by the
framework as it is ?