|
| Console (18) | |
| Hey there all. I'm an aspiring C++ coder like a lot of people here, and aspiring coders usually have questions like myself. (Note, all questions are console related, not with GUI commands) 1.) Launching another program from your program I have no idea if it is or not, but I would like to know how to launch another program from my own, like a secondary launcher, where if "X" was pressed, "THIS.filetype" would launch. I know this is possible with *.bat files, by typing the directory and then the file name and extension, but it isn't very useful if you only want to launch a certain program and don't want 20 *.bat files on your Desktop or wherever you plan to store it. 2.) Making the program write a file (Updated) | |
Last edited on | |
| Console (18) | |
| Bump | |
| firedraco (2048) | |
| I don't believe you can just "launch" a program without resorting to some OS specific commands...there might be a library out there with something about that however, you could try searching for "launch program from console app" or something like that. | |
| Bazzy (3180) | |
| To write to a file without deleting the old contents, enable the ios::app flag when opening the file. To launch a file you can use the ShellExecute function from Win API http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx | |
| Zaita (2112) | |
system("command here"); | |
| anders43 (123) | |
| 1) Lookup the function ShellExecute from the Win32 which gives you more possibilities when launching than system() 2) It has all to do with how you open the file, if you open the file in append mode you will not overwrite. | |
| Grey Wolf (1407) | |
| CreateProcess is another option for item 1) http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx | |
This topic is archived - New replies not allowed.
