Solved

How can I launch my application inside another application in MFC

Posted on 2009-04-08
8
373 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
 
LVL 1

Expert Comment

by:DaRakNa
ID: 24102860
No need to include dos.h for this function.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now