can't run program

Apr 15, 2013 at 2:21pm
i followed this tutorial about RPC server and client programs:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa379010(v=vs.85).aspx

I got the server and client to compile successfully but i don't know how to actually run the programs. In the tutorial it says
To run the application on a single computer, open two console windows. In the first window, type
hellos
and in the second window, type
helloc


i called my programs msdnServer and msdnClient so i typed those into the console window but nothing happened.

why can't i just run it in visual studios?
Apr 15, 2013 at 3:17pm
You could just navigate to where the binaries are compiled and double click on them. Otherwise use 'cd' to change the directory and copy paste the path into the command line.
Apr 15, 2013 at 3:25pm
tried both of those and nothing happens. if i double click on the exe files the console window just appears for a second then disappears
Apr 15, 2013 at 3:42pm
I've actually done these tutorials so I know they work, I used Windows XP but that shouldn't matter in this context. If they are both just dying instantly then my guess would be that they are hitting one of the "if-this-function-failed" errors. When you run them from a console you can redirect STDERR by appending "2>&1" after the command line to launch the app (this works on ALL command line programs btw). I hope you gave each of those errors a unique error code, I don't think the tutorial does.

EDIT: Relavent http://support.microsoft.com/kb/110930
Last edited on Apr 15, 2013 at 3:43pm
Apr 15, 2013 at 3:44pm
when i try debug the program and console window just says press any key to continue...
Apr 15, 2013 at 3:47pm
Upon review of your link this is in fact NOT the tutorial that I have done before. I'll go over the code real quick and try to see why it might be doing this.
Apr 15, 2013 at 3:56pm
You shouldn't see "press any key to continue" on either of these, either something you wrote is calling "system(pause);" or the executable is still running inside of a shell. Either way the function "exit(int)" passes the exit code from the 'status' variable to STDERR so you should still grab that and let us know what it says so that we can help you.
Apr 16, 2013 at 7:47am
the problem in both the server and client is when it reaches the if (status) it then executes exit(status); so it doesn't run the rest of the program. what is the tutorial you did before? i found it very hard to find a simple tutorial
Topic archived. No new replies allowed.