Solved

How can I launch my application inside another application in MFC

Posted on 2009-04-08
8
402 Views
Last Modified: 2013-11-20
Experts,

What is the simplest or easiest technique for launching one of my applications inside another of my applications in MFC VC++ 6.0?
0
Comment
Question by:JPM2002
  • 5
  • 2
8 Comments
 
LVL 4

Expert Comment

by:StefanKittel
ID: 24102394
Hello,

what do you mean? Please specify.

Stefan
0
 
LVL 1

Expert Comment

by:DaRakNa
ID: 24102848
Command is:

You must replace "C:\\Cpp\\ExpertExchange\\2x.exe" with your second program exact location.
ShellExecute(NULL, NULL,"C:\\Cpp\\ExpertExchange\\2x.exe",NULL, NULL, SW_SHOWNORMAL);

Open in new window

0
 
LVL 1

Expert Comment

by:DaRakNa
ID: 24102853
Also you must include dos.h library.
#include <dos.h>

Open in new window

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:DaRakNa
ID: 24102860
No need to include dos.h for this function.
0
 

Author Comment

by:JPM2002
ID: 24103307
doesn't work.

Here is what I typed

HINSTANCE H;

H = ShellExecute(NULL, NULL, "C:\\Projects\\2PC\\Debug,NULL,NULL,SW_SHOWNORMAL");





I get 2 errors

error 2001: newline in constant    // I don't see any newlines

error 2143: syntax error: missing ')' before string  // don't see any parentheses missing
0
 
LVL 1

Expert Comment

by:DaRakNa
ID: 24103313
Try this:
HINSTANCE H;
 
H = ShellExecute(NULL, NULL, "C:\\Projects\\2PC\\Debug.exe",NULL,NULL,SW_SHOWNORMAL);

Open in new window

0
 

Author Comment

by:JPM2002
ID: 24103351
Not needed... I found that I had an extra quotation mark at the end before the closing parentheses
that was causing the errors.

Thanks it works great.


0
 
LVL 1

Accepted Solution

by:
DaRakNa earned 250 total points
ID: 24103407
Great. Don't forget to accept solution and asign points. :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 94
Separate files macro - Errors on larger data set 18 73
noX challenge 17 130
Annoying "thing" blocks my view 4 117
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question