Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WinExedc or Create Process

Posted on 1998-06-17
5
Medium Priority
?
165 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
[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
  • 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

598 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