Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 30th, 2006, 5:38 PM   #1
jobobshishkabob
Programmer
 
Join Date: Jan 2006
Location: Texas
Posts: 36
Rep Power: 0 jobobshishkabob is on a distinguished road
Program keeps on closing

Yes i know i kind of asked this before...

I have many files in a folder, and i want a "program.exe" in the main page, along with a read-me and an uninstall file.

So i made a program to do it:
#include <iostream>

using namespace std;

int main()
{
    system("start prgm\ddwwn.exe");
}

It works fine, but when try to open another exe file through ddwwn.exe, it just closes...

i know i can fix this problem by puting a system("pause"); tag in the program.exe file, but i dont want it to just stay there.

Is there another option?

Sorry for repeating this question....
jobobshishkabob is offline   Reply With Quote
Old Jan 30th, 2006, 5:44 PM   #2
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Can I ask what you are trying to do with all these questions? Using installers, hide files, run programs and websites? It reminds me of a "hack" I was trying to create a few years ago when I was bored, living in the country(I didn't have internet, I didn't send it to anyone, just playing around with myself(lol) while I had no life at all).

If you are attempting to create a "virus/hack", Please at least use your own code and not installers, there is nothing more lame than using another persons program to help you with a malicious file. I would know. If you aren't using all this stuff for what i'm thinking though, forget I said anything. I am at a point in my winsock server/client where I am attempting to create my own commands and running websites is one of them so I can't really say anything to you about that either way.

As for your question, Threads or a loop would work I am not too sure I understand what you mean by run programs through "program.exe" though.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old Jan 30th, 2006, 6:06 PM   #3
jobobshishkabob
Programmer
 
Join Date: Jan 2006
Location: Texas
Posts: 36
Rep Power: 0 jobobshishkabob is on a distinguished road
no no no! im sorry you completely mis understood. im not making a hack. im a student making a science fair project. ddwwn stands for "differfentiating dengue with west nile".

and what i meant by saying running a exe through ddwwn.exe was i was saying system("example.exe") in ddwwn.exe.

sorry for the confusion i should really elaborate more.
jobobshishkabob is offline   Reply With Quote
Old Jan 30th, 2006, 6:20 PM   #4
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
I don't understand what the problem is? You don't have access to ddwwn unless you have the source code or can pass it paramaters.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Jan 30th, 2006, 6:21 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I believe you've asked this question before, and been answered. If you wish to use the system command repeatedly, you need to put it in a loop. The loop should ask for the name of the next program you wish to run (or get it from a list). This keeps up until you enter a token to terminate the program (or exhaust the list). It isn't necessary to use the system call; there are other ways to execute programs that my give you more feedback. As far as programs closing when they're through, that's what they're supposed to do. If you want termination to be contingent upon user input, then you have to ask for user input. This issue has been discussed ad nauseum on this forum and every other forum from Fink, Texas to Bangalore. I would suggest that you write some serious code and return for help. Four lines of junk written while ignoring your previous answers and advice isn't hacking it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jan 30th, 2006, 6:26 PM   #6
jobobshishkabob
Programmer
 
Join Date: Jan 2006
Location: Texas
Posts: 36
Rep Power: 0 jobobshishkabob is on a distinguished road
i do have the source code because i made it
jobobshishkabob is offline   Reply With Quote
Old Jan 30th, 2006, 9:44 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
So do you want us to look at it and make suggestions, or is it a secret, or is it just fine and the sample above is what you need to work on?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:50 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC