C++ code help
hey whats up, im in the process of making a rombox for some old snes and other systems games
i want the system to be totally mouseless, so what i plan on doing is crating a exe in C++ and loading that into the autoexec.bat ( yea the rombox is running 98 lol )
as far as the C++ code is conserned, i havent had a C++ lesson in years and i just wanna try to get it right bofore i exterminate the rombox
so far in the code u have a small little selection menu to choose what emulator to launch depending on the # you enter. Is it possible that once a selection is made that the C++ prog actually launch the exe of the pathed emulator as such
if selection = 1;
then ( *launch the prog from the path )
lol probly a bit crude but gimme some credit its been like 5 years and im only needing this skill now lol
i want the system to be totally mouseless, so what i plan on doing is crating a exe in C++ and loading that into the autoexec.bat ( yea the rombox is running 98 lol )
as far as the C++ code is conserned, i havent had a C++ lesson in years and i just wanna try to get it right bofore i exterminate the rombox
so far in the code u have a small little selection menu to choose what emulator to launch depending on the # you enter. Is it possible that once a selection is made that the C++ prog actually launch the exe of the pathed emulator as such
if selection = 1;
then ( *launch the prog from the path )
lol probly a bit crude but gimme some credit its been like 5 years and im only needing this skill now lol
0
Comments
can any 1 help me out??
the libraries didnt like the lessthan and greaterthan symbols
#include iostream.h #include shellapi.h //#include shell32.lib main () { int slection int value = 4 do { cout <<"===========================================================================" cout << "This menu will help you decide which game emulator you would like to play "; cout << "1. Will open the 1st and Roms "; cout << "2. Will open the 2nd and Roms "; cout << "3. Will open the 3rd Emulator and roms "; cout <<"===========================================================================" cin >> selection if selection = 1; then ShellExecute(handle, "open", C:\GBA\1.exe, NULL, NULL SW_SHOWNORMAL); if selection = 2; then ShellExecute(handle, "open", C:\SNES\2.exe, NULL, NULL SW_SHOWNORMAL); if selection = 3; then ShellExecute(handle, "open", C:\MAME\3.exe, NULL, NULL SW_SHOWNORMAL); } while selection > value; return 0; }#include < iostream > #include < iomanip > using namespace std; int main() { system("I:\\STUFF\\Zips\\550Mhz\\wins3id.exe"); }worked fine for me using VS.NET 2003 on winXP where wins3id.exe is what i want to run. make sure to use double \\ for the folders. I had to put spaces between < and the libraries because of the code tag.int selection = -1; int value = 4; cout <<"================================================== =========================\n"; cout << "This menu will help you decide which game emulator you would like to play\n"; cout << "1. Will open the 1st and Roms\n"; cout << "2. Will open the 2nd and Roms\n"; cout << "3. Will open the 3rd Emulator and roms\n"; cout <<"================================================== =========================\n"; while(1){ [indent] cin >> selection; if(selection == 1) { //put the code here } else if (selection == 2) { //put the code here } else if (selection == 3) { //put the code here } else { cout << "Please enter a selection from 1-3\n"; } [/indent] }Although I'm not sure if reading in a char with cin and then comparing it to an int will work. I mostly do JAVA.
If it's simple like Press 1 for emulator X or 2 for emulator Y, then use a batch file.
well it is that "simple" but i know more about C++ than i do about the basics about a batch file =\
it was my frist intentions of doing it like that but i couldnt remember how to print the menu lol