code_junkie

Modal operation using IMessageFilter and DoEvents

Nov 13th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Application::AddMessageFilter(someFilter);
  2. while(someFilter->HasUserSelectedAPoint_Or_HitEscapeKey()){
  3. Application::DoEvents();
  4. }
  5. Application::RemoveMessageFilter(someFilter);
  6.  
  7. Application::AddMessageFilter(someFilter);
  8. while(someFilter->HasUserSelectedAPoint_Or_HitEscapeKey()){
  9. // Assuming that ManagedGetMessage() below is a blocking
  10. // call which yields control to the OS
  11. if(ManagedGetMessage())
  12. Application::DoEvents();
  13. }
  14. Application::RemoveMessageFilter(someFilter);
Add Comment
Please, Sign In to add comment