Author |
Message |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Sat Mar 08, 2008 10:42 pm Post subject: help with c++ |
|
|
|
|
im trynna make a program that opens the following windows but i have a problem, it opens the first window (subbill) and turns others for like 1 second and closes them
here is the code else if (option == "run")
{
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
cout<<"Feature is being worked on \n";
system("pause");
ShellExecute(NULL, "open", "server\\Subbill.exe", NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "server\\subgame2.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "bot\\MERVbot.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "bot1\\MERVbot.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "bot1\\MERVbot.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
return main();
} |
can you tell me why is it happening and how to fix it? |
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:31 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat Mar 08, 2008 11:16 pm Post subject: |
|
|
|
|
does it open for more than a second when you open it normally(double clicking)? |
|
Back to top |
|
|
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Sat Mar 08, 2008 11:41 pm Post subject: |
|
|
|
|
? no but i did sleep(3000) just to make sure since i thought maybe timing was the problem, but do you know why all other programs close except for subbill? |
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Mon Mar 10, 2008 1:40 pm Post subject: |
|
|
|
|
Can you even call Sleep() if you're not a thread? |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Mon Mar 10, 2008 1:45 pm Post subject: |
|
|
|
|
Crap... are we getting philosophical? If so, it's going over my head :( |
|
Back to top |
|
|
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Tue Mar 11, 2008 5:07 pm Post subject: |
|
|
|
|
Bak wrote: | when you double click on them in that order, do they stay open? |
yes they do stay open
Quote: | They are probably closing because he has not provided the working directory. Which means they cant find the files they are looking for. |
no it finds it and opens it up, and it says subgame and the bots do open they just close a second later but you get a chance to see what it says |
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:31 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue Mar 11, 2008 5:32 pm Post subject: |
|
|
|
|
maybe the program has a problem with how you're opening it? just a guess. |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
|
Purge Episode I > Eposide III Jar-Jar is kool
Age:34 Gender: Joined: Sep 08 2004 Posts: 2018 Offline
|
Posted: Tue Mar 11, 2008 6:48 pm Post subject: Re: help with c++ |
|
|
|
|
hellzlaker wrote: | im trynna make a program that opens the following windows but i have a problem, it opens the first window (subbill) and turns others for like 1 second and closes them
here is the code else if (option == "run")
{
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
cout<<"Feature is being worked on \n";
system("pause");
ShellExecute(NULL, "open", "server\\Subbill.exe", NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "server\\subgame2.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "bot\\MERVbot.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "bot1\\MERVbot.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
ShellExecute(NULL, "open", "bot1\\MERVbot.exe",NULL, NULL, SW_SHOWNORMAL);
Sleep(3000);
return main();
} |
can you tell me why is it happening and how to fix it? |
Can you actually compare strings with an equalto in C++? I know you can in Java, but I thought in C++ you have to use a function like strcmp() or something.
If not, I'm surprised it goes through the loop. |
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Tue Mar 11, 2008 6:57 pm Post subject: |
|
|
|
|
If it is a string class, the == is overloaded to work. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Mar 11, 2008 11:00 pm Post subject: |
|
|
|
|
Note: You shouldn't use == in Java, since it's not guaranteed to work (but usually does because of internal stuff), especially with strings from external sources. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
|
|