469,325 Members | 1,526 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

How to get return value from a spawned process?

Hi,

I have the following scenarios: client/server programs implemented with
winsock are installed on all systems inthe network (assume it contains s1,
s2, and s3, and other systems). If I send a command from s0 client to s1
server, which ask s1 server to execute a command line of s1 client to talk
with s2 server, s2 server will return value (error code in my case) to s1
client. My question is how I can get the returned value on s0?

The command line execution on s1 is realized by calling system(), to which I
pass the client program name (the client program will returns error code),
and the processed data from s0, but system() only return -1 or 0 to indicate
error or succeed. I also looked at CreateProcess(), but still couldn't see
how I can get the returned value from client execution.

Anybody got idea?

Thanks,
Peter
Jul 22 '05 #1
1 1875
"Peter" <yb***@yahoo.com> wrote...
I have the following scenarios: client/server programs implemented with
winsock are installed on all systems inthe network (assume it contains s1,
s2, and s3, and other systems). If I send a command from s0 client to s1
server, which ask s1 server to execute a command line of s1 client to talk
with s2 server, s2 server will return value (error code in my case) to s1
client. My question is how I can get the returned value on s0?

The command line execution on s1 is realized by calling system(), to which I pass the client program name (the client program will returns error code),
and the processed data from s0, but system() only return -1 or 0 to indicate error or succeed. I also looked at CreateProcess(), but still couldn't see
how I can get the returned value from client execution.

Anybody got idea?


Since we can only suggest solutions that are or can be written in the
Standard C++, my only suggestion is to create a file with all the return
codes you want.

The rest is off-topic.

Victor
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Mike M | last post: by
6 posts views Thread by news.microsoft.com | last post: by
6 posts views Thread by Zeya | last post: by
4 posts views Thread by Kevin | last post: by
1 post views Thread by =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post: by
1 post views Thread by Vishal Sethia | last post: by
reply views Thread by loorthu | last post: by
4 posts views Thread by A Nonymous | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.