Problem with remoteExecute and IProces().Terminate

delphi package - getting into other processes

Problem with remoteExecute and IProces().Terminate

Postby Mazinger » Tue Nov 08, 2005 11:24 am

Hi,

I use on my app madRemote and madKernel.

The sequence is:

1. Create a process with CreateProcess API (iPH)

2. In some time, from my app, call RemoteExec to change an environment variable of iPH.

3. When my app is closing, madKernel Process(iPH).Terminate.

All works fine if I don't execute point 2. But if I execute point 2 my app generates a EExternalException when point 3 is executed.

Any idea to solve this?

Thanks.
Mazinger
 
Posts: 33
Joined: Wed Jan 26, 2005 6:26 am

Postby Mazinger » Tue Nov 08, 2005 1:42 pm

If I use Windows.TerminateProcess instead Process(iPH).Terminate all works fine.

I use madExcept too in my app.

BTW, What's the difference between Windows API TerminateProcess and madKernel's IProcess.Terminate?

Thanks
Mazinger
 
Posts: 33
Joined: Wed Jan 26, 2005 6:26 am

Postby madshi » Tue Nov 08, 2005 7:47 pm

That's quite strange, that step 2 results in problems with step 3, because madRemote.RemoteExecute and madKernel.IProcess.Terminate theoretically have nothing to do with each other.

Anyway, using Windows.TerminateProcess is basically the same as calling Process(iPH).Terminate. Actually Process(iPH).Terminate internally calls Windows.TerminateProcess, too. So you can continue to use this workaround.
madshi
Site Admin
 
Posts: 9472
Joined: Sun Mar 21, 2004 5:25 pm


Return to madRemote

Who is online

Users browsing this forum: No registered users and 1 guest

cron