4 Replies - 570 Views - Last Post: 18 November 2011 - 06:42 AM Rate Topic: -----

#1 PricelineNegotiator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-November 11

How to start two programs using C++

Posted 17 November 2011 - 10:55 PM

Hm, well I am having a hard time understanding exactly how I would do this but this is what I want to do:

I have two programs that I want to start. One followed by the other. Each program that is started will have it's own extensions to it. The first program is a 3D voice client. The second is a game executable. For the voice client (Mumble), I would like to add the following to the .exe so that it connects it to a specific server upon running. The game (Project Reality, a mod for BF2)executable will run and will log in the player with their username and password that is inputted (is that a word?) by the user.

We figured it out in batch, but it is different for each operating system and not every person have their mumble and game installed onto drive C.

!WARNING! THIS IS BATCH.
@echo off
start "" "C:\Program Files (x86)\PR Mumble\pr_mumble.exe" mumble://YOURNICK@mumble.realitymod.com:64739/?version=1.2.0 -m
"E:\Games\BF2\mods\pr\pr.exe" +restart +playerName YOURLOGIN +playerPassword YOURPASS
taskkill /IM pr_mumble.exe /F
exit


The code isn't mine. Someone else who is working with my wrote it, so that's why it's in batch.

So, here is the timeline I am trying to create:

1. Run Project_Reality+Mumble.exe
2. Ask user for username and password
3. Pass username and password into the Project Reality as YOURLOGIN and YOURPASS
4. Since the Mumble extension is fine as stated above, nothing needs to happen before it runs
5. Run Project_Reality.exe

But there are some catches. Since not everyone is using Windows 7 64 bit and has Project Reality and Mumble installed in their Program Files (x86) folder, the code has to be flexible. Either it has to

1. Detect where Mumble and Project Reality are installed..normal program files, x86, on Z drive, or ? drive
2. Ask the user to point the Project_Reality+Mumble.exe to both the Project Reality and Mumble .exe's

I'm not sure how it could detect where both programs are installed, but I believe that asking the user where they are would be the easiest, as you could just pass the values of the directories above the executables into the PR+Mumble.exe.

The only reason why I care at all about doing this is to save our gaming community. Most of the hardcore Project Reality players use this Mumble program which makes the gaming experience absolutely amazing and immerse by providing a 3D voice client on the battlefield. I can hear people on my left on my left side of my headphones and people farther away get quieter. It makes communication extremely easy and liquid. But if we get the people that don't use mumble to basically be forced to use it in our next release, we figure that we'll have a lot more people stick with the mod.

Give me some advice. If it isn't possible in C++, is there another language I could use?

But if you guys are interested in the mod, please feel free to visit www.realitymod.com and sign up for an account. BF2 is only $10 in the United States and your computer needn't be that good! Personally, this is the best gaming experience I have ever had, as the mod focuses entirely on teamwork and enforces reality. Some of our servers run with over 180 players on one map. Map sizes can be anywhere from 1 km x 1 km to 4 km x 4 km. The mod has been in development since 2005.

I'll link you guys some awesome gameplay videos also.
http://www.youtube.c...h?v=vXjl0SXckHg (this one has me as the Apache gunner!)
http://188.40.93.170/tct.html
http://www.youtube.c...h?v=qvWXZhcjkxo
http://www.youtube.c...h?v=2ang_UxL7is
http://www.youtube.c...h?v=ix3e0_iuITs (Mumble

Is This A Good Question/Topic? 0
  • +

Replies To: How to start two programs using C++

#2 AKMafia001  Icon User is offline

  • </code.in.dream>

Reputation: 187
  • View blog
  • Posts: 624
  • Joined: 11-June 11

Re: How to start two programs using C++

Posted 18 November 2011 - 06:11 AM

Well! I have just read your title only :) because your description seems so long... Sorry for that!

Starting one program within other (changing the process image) or starting a new program from the current program you can either use system()(Well! They and I say it's hell! :)) the other way I can suggest you is to fork() a process or use a function from exec family.

Hope this helps!
Was This Post Helpful? 0
  • +
  • -

#3 emorej5000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 18-November 11

Re: How to start two programs using C++

Posted 18 November 2011 - 06:15 AM

View PostAKMafia001, on 18 November 2011 - 06:11 AM, said:

Well! I have just read your title only :) because your description seems so long... Sorry for that!

Starting one program within other (changing the process image) or starting a new program from the current program you can either use system()(Well! They and I say it's hell! :)) the other way I can suggest you is to fork() a process or use a function from exec family.

Hope this helps!

Im working with java
Was This Post Helpful? 0
  • +
  • -

#4 AKMafia001  Icon User is offline

  • </code.in.dream>

Reputation: 187
  • View blog
  • Posts: 624
  • Joined: 11-June 11

Re: How to start two programs using C++

Posted 18 November 2011 - 06:29 AM

But I have answered someone who is using C++. I Guess! :)

This post has been edited by AKMafia001: 18 November 2011 - 06:37 AM

Was This Post Helpful? 0
  • +
  • -

#5 PricelineNegotiator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-November 11

Re: How to start two programs using C++

Posted 18 November 2011 - 06:42 AM

View Postemorej5000, on 18 November 2011 - 06:15 AM, said:

Im working with java


Cool.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1