title: DoModal in critical section
body: <p><br>
  in an parallel loop, there is a critical section. I try to execute an mfc dialog with DoModal in the critical section, however since main thread waits for parallel threads, there is no way for my dialog to show up and execute. In order to break this dependency, I create an executable and I run it as a process within my parallel loop. When the process shows dialog and gets the information. It returns and other threads keeps running.</p>
  
  <p>However my team leader insist that there is a better way to do it which I couldn't figure out after doing hours of search :\<br></p>
  
  <p>I tried a seperate thread in parallel for. It didn't worked.<br>
  I tried CWinThread (google say it is gui thread :\ which didn't helped)<br>
  I tired creating an exe and running it. That worked :)</p>
  
  <pre><code>int someCriticDialog()
  {
    #pragma omp critic (showCriticDlg)
    {
     CMyDialog ccc;
     ccc.DoModal();
     /* However the code below works
        CreateProcess("someCriticDlg.exe", null, &amp;hProcess);
        WaitForSingeObject(hProcess, INFINITE);
     */
    }
  }
  
  #pragma omp parallel
  for (int i = 0; i &lt; 5; i++)
    someCriticDialog();
  </code></pre>