Solved

WinExedc or Create Process

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 96
lucky13 challenge 11 155
Use of condition with 'serial' in ansible 2 71
Problem to open Excel file 15 178
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 …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

832 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