Solved

WinExedc or Create Process

Posted on 1998-06-17
5
146 Views
Last Modified: 2013-11-20
I am trying to spawn another application from within my program.  I am currently using MFC framework to program.  I know that I should use Create Process or WinExec, but I am unsure of the syntax.  I have tried several times, but am unsuccessful.  Does anyone know the proper syntax...
suppose the program is anything.exe

Thanks
0
Comment
Question by:mikeljj
  • 3
5 Comments
 

Author Comment

by:mikeljj
ID: 1318128
Edited text of question
0
 
LVL 1

Expert Comment

by:Dex_Man
ID: 1318129
I was doing something similar. I wanted to open an Excel spreadsheep from with-in my app, by using the associations within Win95. See if:

ShellExecute

is what you want. For me, what works is: (actual line from code)

ShellExecute(NULL, NULL, m_spreadsheet_display_name, NULL, NULL, SW_MAXIMIZE);

-Dex Man



0
 

Author Comment

by:mikeljj
ID: 1318130
Does the application have to include a direct path??
Or does the file or application have to be in the Windows directory--- since this is the only way I can get it to work
0
 
LVL 7

Accepted Solution

by:
galkin earned 50 total points
ID: 1318131
you can use either CreateProcess or WinExec. CreateProcess is recommended. Before calling this function you must fill STARTUPINFO structure, cb member must be set to seziof(STARTUPINFO) and other structure members must be set to 0(NULL).
Valid address to PROCESS_INFORMATION structure must also be specified.
In WinExec you can provide full path to executable or if only file name if EXE in the same directory or in current directory.
I guess Excel is OLE server so it should be launched using OLE CocreateInstance function rather then WinExec
0
 

Author Comment

by:mikeljj
ID: 1318132
thanks, I figured it out
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

14 Experts available now in Live!

Get 1:1 Help Now