Hi, I have a CWnd derived class, say m_Wnd, that has a function foo() which calls RunModalLoop(). RunModalLoop() is used to pause the foo() function until a certain task is completed. When this task is completed it will end RunModalLoop() and the rest of foo() will finish. The user can make many calls to m_Wnd->foo(), but a problem occurs when a previous call is still in RunModalLoop() and a subsequent call is made to RunModalLoop() because m_Wnd is already in a modal state. Is there a way to queue these calls to foo() or RunModalLoop()? I have beginner knowledge in threading..does this require the use of a semaphore?