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.
That way I am displaying modal windows and do other things.
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.
I think it happens because primary SendMessage is in use and com+ calls need windows messaging for its tasks.
Anyway, In delphi I cannot display the form from a thread, but how Could I workaround the problem ... ?
Thanks
EDIT:
- MAIN(UI) 2. A THREAD
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.
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
- MAIN
- MAIN
- MAIN
- CoInitializeEx(nil, COINIT_MULTITHREADED);
- yes.
1.
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 aSendMessage
handler? – CartSynchronize
to call the com+ in the main VCL thread? – Dragonroot