Open something with System

Posts 1–12 of 12 · Page 1 of 1
Open something with System
Ok, this is for my science project:

D.O.G.M.A. ROBOT

Well, basically I want to be able to switch between keyboard and voice. I created two separate C++ CMD programs to do so. In total I have 3:

MAIN - Sets everything, checks files, preps the ROBOT
Voice - Self Explanatory, allows me to use ROBOT with voice
Keyboard- Self Explanatory, allows me to use ROBOT with keyboard

From MAIN I open Voice with system();
How can I go back to the function I was in after I close Voice?
I don't know how system() runs programs. But running programs is usually a host process ( usually the kernel ) that passes execution over to the program you're opening ( calls main function ). So a simple return statement should bring you back to your caller ( MAIN in your case ).

But I don't know how the fk system() works so Idk, but its worth a shot.
Quote Originally Posted by Void View Post
I don't know how system() runs programs. But running programs is usually a host process ( usually the kernel ) that passes execution over to the program you're opening ( calls main function ). So a simple return statement should bring you back to your caller ( MAIN in your case ).

But I don't know how the fk system() works so Idk, but its worth a shot.
System just runs an executable or system file from the "system folder" or a similar OS-dependent area.

@OP, I believe that if you just use system with a path to the executable (with no start or anything), it will block until that program exits.
Quote Originally Posted by mmbob View Post
System just runs an executable or system file from the "system folder" or a similar OS-dependent area.

@OP, I believe that if you just use system with a path to the executable (with no start or anything), it will block until that program exits.
system() runs any windows command, all commands compatible with the cmd promt can be provided as arguments for system:

system("pause");
system("dir /s")

etc. etc
I will give it a try...will post back with results
I'm curious, how the hell do you program a robot? I mean like, what hardware & OS are you programming over etc etc..

\:
Quote Originally Posted by Void View Post
I'm curious, how the hell do you program a robot? I mean like, what hardware & OS are you programming over etc etc..

\:
Well, actually this robot is kind of a robot and its not.

This is basically it:

Im using all components from different PC's.

I completely modded Windows XP, like removing almost EVERYTHING, and leaving the basics.

If you want to know about how to make it move then that is completely different. You can build your own boards for that(will take some time), or you can buy premade ones, that sell for 100-200 bucks each.

I dont know if it counts as a robot or not but it has a robot aspect to it.


I will post my entire source code for my entire robot so you can see once im done.
Quote Originally Posted by aanthonyz View Post
Well, actually this robot is kind of a robot and its not.

This is basically it:

Im using all components from different PC's.

I completely modded Windows XP, like removing almost EVERYTHING, and leaving the basics.

If you want to know about how to make it move then that is completely different. You can build your own boards for that(will take some time), or you can buy premade ones, that sell for 100-200 bucks each.

I dont know if it counts as a robot or not but it has a robot aspect to it.


I will post my entire source code for my entire robot so you can see once im done.
You should totally scrap any OS and code to whole thing in 16-bit real-mode.
Quote Originally Posted by Void View Post
You should totally scrap any OS and code to whole thing in 16-bit real-mode.
Its due April 24th you think I got time.

Im open to any ideas...
Woah, is this like a real hardware robot? O:
Quote Originally Posted by freedompeace View Post
Woah, is this like a real hardware robot? O:
What do you mean by real hardware robot?
Use CreateProcess to start the process, then:
Code:
WaitForSingleObject( pi.hProcess, INFINITE );
That'll wait till the program exited then continues execution
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us