Solved

WinExedc or Create Process

Posted on 1998-06-17
5
149 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to include alternate header placement and naming 5 66
Add content to output file 4 62
substring method in java 1 96
mapBully challenge 6 113
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…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

919 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

12 Experts available now in Live!

Get 1:1 Help Now