|
-
January 9th, 2009, 11:53 AM
#1
Button to launch files
Hi,
I'm new to C++ and I came from VB .Net
I'm using Microsoft Visual C++ Express 2008 and I am trying to launch files from a button.
In VB .Net, I did this way:
Code:
Dim myProcess As New Process
myProcess.StartInfo.WorkingDirectory = "Files"
myProcess.StartInfo.FileName = "Test.exe"
myProcess.Start()
My program will be used across multiple PCs so I had to set the directory of where the file was located then call forth the name of the file in the next line. I was wondering how I would do that in Visual C++.
Thanks
Last edited by weirddemon; January 9th, 2009 at 11:55 AM.
-
January 9th, 2009, 12:19 PM
#2
Re: Button to launch files
Use CreateProcess API or ShellExecute (or ShellExecuteEx)
Victor Nijegorodov
-
January 10th, 2009, 05:52 AM
#3
Re: Button to launch files
 Originally Posted by weirddemon
Hi,
I'm new to C++ and I came from VB .Net
I'm using Microsoft Visual C++ Express 2008 and I am trying to launch files from a button.
In VB .Net, I did this way:
Code:
Dim myProcess As New Process
myProcess.StartInfo.WorkingDirectory = "Files"
myProcess.StartInfo.FileName = "Test.exe"
myProcess.Start()
My program will be used across multiple PCs so I had to set the directory of where the file was located then call forth the name of the file in the next line. I was wondering how I would do that in Visual C++.
Thanks
See
(A newbie's elementary guide to spawning processes)
http://www.codeproject.com/KB/system/newbiespawn.aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|