Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Apr 29th, 2005, 10:24 AM   #11
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
try this:

#include <iostream>

using namespace std;

int main (void)
{
    string x = "CMD /C yourCommandHere";
    system(x.c_str());
    return 0;
}
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Apr 29th, 2005, 1:54 PM   #12
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
??

Quote:
Originally Posted by Eggbert
You need to write a Win32 application without creating a window. Console mode programs will always open a console window-unless run from the command line-and leave it up until the program is finished.
Dont know if I understood it right....

My C application does not have a window, but still I need call it by passing 3 parameters, what I did was a .bat file calling the C program passing these parameters like this:

C:\program.exe par1 par2 par3

But when I execute this .bat file it comes up with the DOS window.... and that is what I dont want to happen. Maybe Im doing it wrong... is the .bat file the best way?

Thx again.
hipolito is offline   Reply With Quote
Old Apr 29th, 2005, 6:14 PM   #13
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You could always make a shortcut.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 3rd, 2005, 10:11 AM   #14
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
Short cut???
hipolito is offline   Reply With Quote
Old May 3rd, 2005, 11:23 AM   #15
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Yeah... you know... right-click -> New -> Shortcut...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 3rd, 2005, 11:45 AM   #16
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
Ohhh I see, yes, OMG, simple and nice.... thx, but I still have the DOS window poping up.... I have to run it on the background...
hipolito is offline   Reply With Quote
Old May 3rd, 2005, 12:56 PM   #17
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Like Eggbert said, you need to create a Win32 application. Try checking out www.functionx.com.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 4th, 2005, 9:15 AM   #18
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
Wow

Quote:
Originally Posted by Ooble
Like Eggbert said, you need to create a Win32 application. Try checking out www.functionx.com.
Hey, very nice WEBSITE, thx man.

Well, I think I figured out how to do it.
Ill try to use the freeconsole() command on my script, wich it will be called by the .bat file that close itself and the C programm wont stop.
Ill see and let you know.

thx again.
hipolito is offline   Reply With Quote
Old May 4th, 2005, 10:13 AM   #19
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Or you could just not use a batch file...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 4th, 2005, 10:35 AM   #20
hipolito
Programmer
 
Join Date: Feb 2005
Posts: 41
Rep Power: 0 hipolito is on a distinguished road
hmmm

Quote:
Originally Posted by Ooble
Or you could just not use a batch file...
Well, I thought of the batch file becouse I need to pass the parameters.

The freeconsole() worked just fine, but I cant manage to close the window by using CLS on the batch file.

Got any better idea?

Thx.
hipolito 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 5:20 AM.

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