How can I launch my application inside another application in MFC

Experts,

What is the simplest or easiest technique for launching one of my applications inside another of my applications in MFC VC++ 6.0?
JPM2002Asked:
Who is Participating?
 
DaRakNaConnect With a Mentor Commented:
Great. Don't forget to accept solution and asign points. :)
0
 
StefanKittelCommented:
Hello,

what do you mean? Please specify.

Stefan
0
 
DaRakNaCommented:
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
DaRakNaCommented:
Also you must include dos.h library.
#include <dos.h>

Open in new window

0
 
DaRakNaCommented:
No need to include dos.h for this function.
0
 
JPM2002Author Commented:
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
 
DaRakNaCommented:
Try this:
HINSTANCE H;
 
H = ShellExecute(NULL, NULL, "C:\\Projects\\2PC\\Debug.exe",NULL,NULL,SW_SHOWNORMAL);

Open in new window

0
 
JPM2002Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.