title: Threading, com+ calls with SendMessage messaging
body: <p>I have an app which creates a thread which communicate with the main UI via windows messages. It simply send the message to the main app thread and received the status.</p>
  
  <p>That way I am displaying modal windows and do other things.</p>
  
  <p>The problem is when I have to display a form which makes a call to a com+ server.
  That way I get OLE error 8001010D: An outgoing call cannot be made since the application is dispatching an input synchronous call.</p>
  
  <p>I think it happens because primary SendMessage is in use and com+ calls need windows messaging for its tasks.</p>
  
  <p>Anyway, In delphi I cannot display the form from a thread, but how Could I workaround the problem ... ?</p>
  
  <p>Thanks</p>
  
  <h2>EDIT:</h2>
  
  <ol>
  <li>MAIN(UI)             2. A THREAD</li>
  </ol>
  
  <p>A. A Thread(2) sends message to a main thread (1)
  B. Main thread(1) receives the msg and before letting it come back to a thread
     it displays the window.
  C. The modal window in main thread wants to make a com+ call, the above error occurs.</p>
  
  <hr>
  
  <ol>
  <li><p>What thread the modal window is in? 2. Which thread the COM call goes from? 3. Which thread the COM object was instantiated in? 4. Is the background thread initialized with an STA? 5. Is the modal form being shown from a SendMessage handler? – Roman R. 2 mins ago</p>
  
  <ol>
  <li>MAIN</li>
  <li>MAIN</li>
  <li>MAIN</li>
  <li>CoInitializeEx(nil, COINIT_MULTITHREADED);</li>
  <li>yes.</li>
  </ol></li>
  </ol>