First of all. Game.CPP is a source file, not an executable.
what you need to do is locate the appropriate command to fire off a batch file in a DOS window or just fire off another executable that happens to be a console vs a UI app.
then in the code that handles the button click and what is needed to accomplish the above.
ok so what I did instead, because it has to be all c++, was to put the two in their own projects and In the form's button click event do system("path to game.cpp's executable file but it still doesn't open it. Is it trying to open it in the form instead of the console?
That demo program creates a new command windows and sends it the program's command-line arguments as the command to be executed. You can pretty much follow it verbatim, you just need to change the first parameter of CreateProcess to the path to your .exe, and change the second parameter to NULL (unless you want to send command-line arguments to the program).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.