Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I launch my application inside another application in MFC

Posted on 2009-04-08
8
Medium Priority
?
425 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 1000 total points
ID: 24103407
Great. Don't forget to accept solution and asign points. :)
0

Featured Post

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.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

916 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