Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I launch my application inside another application in MFC

Posted on 2009-04-08
8
Medium Priority
?
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 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