🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1390

Re: CreateProcess() in Automation server freezes caller

#1390
From: Remy Lebeau (TeamB)
Date: Tue, 11 Sep 2007 17:25
26 lines
1922 bytes
"Wiebe Vos" <wiebe@foxware.nl> wrote in message
news:46e69558$1@newsgroups.borland.com...

> I'm succesfully launching a thirdparty program via CreateProcess()
> in a COM automation server. The latter is called from our main
> application (which is also a COM automation server so both
> programs can exchange information).

You don't need 2 COM servers for bi-directional communication to work.

> The problem I face is that, during the execution of the thirdparty
> program, the main application is completely blocked.

As it should be.  You designed your COM function to block the caller until
the work is done.

> How can I avoid this?

You need to either 1) change the design of your COM function to not block
the caller anymore, such as by exposing an asynchronous event that is
triggered when the work is done, or else 2) call the function in the context
of a worker thread within the main app instead of in its main thread.


Gambit
Technical Details
Message-ID: <46e6cfc6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46e69558$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ab74d8f845bd4978
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <46e69558$1@newsgroups.borland.com>
Subject: Re: CreateProcess() in Automation server freezes caller
Date: Tue, 11 Sep 2007 10:25:31 -0700
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.29.61
Message-ID: <46e6cfc6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1189531590 75.83.29.61 (11 Sep 2007 10:26:30 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 1776