Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
help with c++

 
Post new topic   Reply to topic Printable version
 View previous topic  which computer language should i learn... Post :: Post A3 Desktop Shortcuts  View next topic  
Author Message
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sat Mar 08, 2008 10:42 pm    Post subject: help with c++ Reply to topic Reply with quote

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
Code: Show/Hide
          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
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
tcsoccerman
Server Help Squatter


Age:30
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat Mar 08, 2008 11:16 pm    Post subject: Reply to topic Reply with quote

does it open for more than a second when you open it normally(double clicking)?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sat Mar 08, 2008 11:41 pm    Post subject: Reply to topic Reply with quote

? 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
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Bak
?ls -s
0 in


Age:23
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sun Mar 09, 2008 6:09 am    Post subject: Reply to topic Reply with quote

when you double click on them in that order, do they stay open?
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:34
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Mon Mar 10, 2008 1:40 pm    Post subject: Reply to topic Reply with quote

Can you even call Sleep() if you're not a thread?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Mon Mar 10, 2008 1:44 pm    Post subject: Reply to topic Reply with quote

Animate Dreams wrote:
Can you even call Sleep() if you're not a thread?

You are always in a Thread icon_smile.gif

Code: Show/Hide

HINSTANCE ShellExecute(     
    HWND hwnd,
    LPCTSTR lpOperation,
    LPCTSTR lpFile,
    LPCTSTR lpParameters,
    LPCTSTR lpDirectory,
    INT nShowCmd
);



They are probably closing because he has not provided the working directory. Which means they cant find the files they are looking for.
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps


Last edited by Doc Flabby on Mon Mar 10, 2008 1:46 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:34
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Mon Mar 10, 2008 1:45 pm    Post subject: Reply to topic Reply with quote

Crap... are we getting philosophical? If so, it's going over my head :(
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Tue Mar 11, 2008 5:07 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
tcsoccerman
Server Help Squatter


Age:30
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Tue Mar 11, 2008 5:32 pm    Post subject: Reply to topic Reply with quote

maybe the program has a problem with how you're opening it? just a guess.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Tue Mar 11, 2008 5:47 pm    Post subject: Reply to topic Reply with quote

hellzlaker wrote:
[..]
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


The working directory is not subgame2.exe. Its the directory subgame is in. You need to reference it,so it loads properly, when you run shell execute put the folder subgame where lpDirectory goes.


Example
Code: Show/Hide

ShellExecute(NULL, "open", "server\\subgame2.exe",NULL, "server\\", SW_SHOWNORMAL);
[/code]
Back to top
View users profile Send private message Add User to Ignore List
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:32
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2018
Offline

PostPosted: Tue Mar 11, 2008 6:48 pm    Post subject: Re: help with c++ Reply to topic Reply with quote

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
Code: Show/Hide
          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
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:39
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3609
Location: Las Vegas
Offline

PostPosted: Tue Mar 11, 2008 6:57 pm    Post subject: Reply to topic Reply with quote

If it is a string class, the == is overloaded to work.
Back to top
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


Age:36
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue Mar 11, 2008 11:00 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 60 page(s) served in previous 5 minutes.

phpBB Created this page in 0.110891 seconds : 38 queries executed (38.6%): GZIP compression disabled