triggering another software via C++

Feb 8, 2010 at 6:09am
hye all..
i'm a beginner and i'm having a problem in C++.
Is C++ can be use to open an another software? if the answer is YES. how should i do it? should i call the directories of the software?

-noobme-
Feb 8, 2010 at 1:15pm
If you're on windows try http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx
system("path and name") should work too. system is evil, though (see http://www.cplusplus.com/forum/articles/11153/)
Feb 8, 2010 at 2:30pm
Yes, but starting other programs is the purpose of system(), so this would be a valid use.

However, it is still a good idea to use an OS-specific function like CreateProcess() or fork()/exec() or popen() etc.
Feb 8, 2010 at 4:09pm
thx both for ur advices..
i really appreciate it.. (^^)
Feb 10, 2010 at 4:32am
I am trying to open a image capturing software called
"Dorgem"

the software is located in
C:\Program Files\Dorgem


as i read in mr.Duoas explaination, the example given is a language to open the text editor..

1
2
3
4
5
6
#include <stdio.h>
#include <stdlib.h>

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
#define EDITOR "notepad"
#endif 



and my problem now is...

how to define the directories so it will run the Dorgem software which located in the directories I stated above?


Feb 10, 2010 at 7:49pm
I didn't really understand you question...
To start "Dorgem.exe" in "C:\Program Files\Dorgem" write
system("C:\\Program Files\\Dorgem\\Dorgem.exe");
Feb 11, 2010 at 9:09am
i'm using windows, from the example that Duoas given, to open a text editor he used the source code below

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
#include <stdlib.h>

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
#define EDITOR "notepad"
#endif

int main()
  {
  printf( "Now I'm going to start your text editor!\n" );
  system( EDITOR );
  printf( "Good-bye!\n" );
  return 0;
  }


would u experts lend me a hand on how should i alter the codes so it will run the software which the directory is C:\Program Files\Dorgem\Dorgem.exe
Feb 11, 2010 at 12:20pm
Don't think line 4 is needed, you already know your using windows.
look at hamsterman's post
Last edited on Feb 11, 2010 at 12:21pm
Mar 3, 2010 at 5:25pm
Thx to the experts for helping me, I managed to run the software via C++ builder by reinstalling the software to the new location
C:\Dorgem\Dorgem.exe

and using this language.

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main()
  {

  system("C:\\Dorgem\\Dorgem.exe");

  printf( "Good-bye!\n" );
  getch();
  return 0;
  }



my program runs through series of routine while the delay counts. Once the Dorgem software is opened using the language above, the whole program paused right away. (the delay sequence stop counting).
So my question is...

1. How to make the delay sequence keeps on counting as usual while the Dorgem software is opened.

2. How to exit the Dorgem software via C++ programming after it is opened using the language above?

plzzz help me out.. Thx..
Topic archived. No new replies allowed.