Start process remotely and wait for execution

F

Fatih Iþýkhan

Hi All,

Is it possible to get return code from remotely started process? Wait
until process stops execution?

Thanks,
 
P

Paul G. Tobey [eMVP]

Sure, maybe. What do you mean by "remotely started process"? You're
running a program on your Windows CE device using ActiveSync and RAPI or
what?

Paul T.
 
F

Fatih Iþýkhan

Sure, maybe. What do you mean by "remotely started process"? You're
running a program on your Windows CE device using ActiveSync and RAPI or
what?

Paul T.

Yes, I am starting process with RAPI through Activesync in WM5.
 
P

Peter Foot

There isn't a WaitForSingleObject API in RAPI so no way to directly wait
while the process executes. Assuming you wrote the device code you could
have it write out to the registry or a file when it has finished and poll
for this from the desktop through RAPI...

Peter
 
F

Fatih Iþýkhan

There isn't a WaitForSingleObject API in RAPI so no way to directly wait
while the process executes. Assuming you wrote the device code you could
have it write out to the registry or a file when it has finished and poll
for this from the desktop through RAPI...

Peter

This is exactly what i am doing right now and I wanted to know if
there is a shortcut.

Thanks,
 
C

Christopher Fairbairn

Hi,

Fatih Isikhan said:
This is exactly what i am doing right now and I wanted to know if
there is a shortcut.

The only other way I know of would to produce a small client side DLL that
contains a function that calls WaitForSingleObject for the specified process
id. You could then use CeRapiInvoke
(http://msdn2.microsoft.com/en-us/library/aa454605.aspx) on your desktop to
have this function execute on your PDA.

Having said that if you've already got a small status flag in the registry
etc doing the above is most likely more effort than it's worth. Especially
with the security implications of attempting to transfer/invoke custom DLLs
via RAPI on many modern Windows Mobile devices.

Hope this helps,
Christopher Fairbairn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top