How to execute an application in VC++ program?

Hi,
Now I want to execute a command line application within VC++ program. How
should I do?
In details, when the VC++ program is executed, I want it to execute another
application automatically.
The application is command line based. Here is how it looks like when
executed.
************************************************
c:\> run application
enter the source file: source.cpp
enter the target file: target.cpp
....
*************************************************
The input source.cpp and target.cpp have already been generated during the
VC++ program. So there is no user input in this case.
I hope the users can see the process of the execution of the application.
That means, "run application" will be executed automatically. The
"source.cpp" and "target.cpp" can be displayed on the screen automatically.
How should I do? I used system(), but it will open a lot of command line
windows and I prefer there is only one window.
Thank you for your reply!!!

--dolphin mark


0
11/18/2003 5:39:11 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
594 Views

Similar Articles

[PageSpeed] 10

Well, you can always use CreateProcess() or even WinExec().  However, unless
the application is wired to handle command-line parameters, you are still
going to get the "enter the..." prompts.

"Dolphin Mark" <dolphinmfc@yahoo.com> wrote in message
news:O5PPLrfrDHA.2480@TK2MSFTNGP10.phx.gbl...
> Hi,
> Now I want to execute a command line application within VC++ program. How
> should I do?
> In details, when the VC++ program is executed, I want it to execute
another
> application automatically.
> The application is command line based. Here is how it looks like when
> executed.
> ************************************************
> c:\> run application
> enter the source file: source.cpp
> enter the target file: target.cpp
> ...
> *************************************************
> The input source.cpp and target.cpp have already been generated during the
> VC++ program. So there is no user input in this case.
> I hope the users can see the process of the execution of the application.
> That means, "run application" will be executed automatically. The
> "source.cpp" and "target.cpp" can be displayed on the screen
automatically.
> How should I do? I used system(), but it will open a lot of command line
> windows and I prefer there is only one window.
> Thank you for your reply!!!
>
> --dolphin mark
>
>


0
david.crow (132)
11/18/2003 6:34:14 PM
ShellExecute is also another method.

Ali

"David Crow [MCSD]" <david.crow@pbsnow.nospam.com> wrote in message
news:GCtub.4490$Du7.2098048020@newssvr30.news.prodigy.com...
> Well, you can always use CreateProcess() or even WinExec().  However,
unless
> the application is wired to handle command-line parameters, you are still
> going to get the "enter the..." prompts.
>
> "Dolphin Mark" <dolphinmfc@yahoo.com> wrote in message
> news:O5PPLrfrDHA.2480@TK2MSFTNGP10.phx.gbl...
> > Hi,
> > Now I want to execute a command line application within VC++ program.
How
> > should I do?
> > In details, when the VC++ program is executed, I want it to execute
> another
> > application automatically.
> > The application is command line based. Here is how it looks like when
> > executed.
> > ************************************************
> > c:\> run application
> > enter the source file: source.cpp
> > enter the target file: target.cpp
> > ...
> > *************************************************
> > The input source.cpp and target.cpp have already been generated during
the
> > VC++ program. So there is no user input in this case.
> > I hope the users can see the process of the execution of the
application.
> > That means, "run application" will be executed automatically. The
> > "source.cpp" and "target.cpp" can be displayed on the screen
> automatically.
> > How should I do? I used system(), but it will open a lot of command line
> > windows and I prefer there is only one window.
> > Thank you for your reply!!!
> >
> > --dolphin mark
> >
> >
>
>


0
nospam8371 (80)
11/18/2003 8:54:00 PM
Reply:

Similar Artilces:

Outlook 2003 Program Requirements
What program does Outlook 2003 use as an e-mail editor? Does it require Office 2003 or can it use any of lower versions of Office products? Larry Soga wrote: > What program does Outlook 2003 use as an e-mail editor? > Does it require Office 2003 or can it use any of lower > versions of Office products? Outlook, all versions, including Outlook 2003 beta, has its own built-in email facilities. You will be unable to install Outlook2003 beta unless you install Office 2003 Beta. -- Donald L McDaniel Post All replies to the Newsgroup, so that all may be informed ====================...

MS Chart Control for VC++9 03-14-10
I am trying to use MSchart control in my Visual C++9, However, the MS chart control in not available in activex list!. I ve downloaded the MS chart control for APS. Net but I couldnt use it with my VC++ programs. Is there any clue? thanks "Azed" <user@msgroups.net/> wrote in message news:OTMhW14wKHA.1692@TK2MSFTNGP04.phx.gbl... > I am trying to use MSchart control in my Visual C++9, However, the MS > chart control in not available in activex list!. I ve downloaded the MS > chart control for APS. Net but I couldnt use it with my VC++ programs. > Is...

Turn application visibility off
I'm writing some VBA code in Excel that needs to send data to Word and then send out the Word documents as attachments to emails. In Word VBA I can say something like Application.Visible=False and this will create the documents in the background without the user seeing everything happening. When it comes to send the emails, the email pops up on the screen before it sends out. I can't find a Visible-equivalent method for the Outlook application. Is there a way to set Outlook or the mailitem object to not display itself? No MailItem object is shown unles you explici...

DoEvents and Execution
I'm using AC2003. I have FormA which has two subform controls on it which do not have a SourceObject assigned to them. I do that in the form_open event, see below. What I'm trying to do is to open a simple OneMomentPlease form that has several colored labels used to indicate progress. As I understand it, a DoEvents statement should force all statements prior to it to execute before any following statements to execute. However, it's not working that way. When FormA is opened it runs through all statements. Each sourceobject contains a fairly complex chart and ta...

When user trying to quit program while thread is running
Hi guys, I have a memory leak problem. When I tried to quit program by click 'x' at top right corner while my ui thread and its child worker thread are running, debugger display following messages: The thread 0x570 has exited with code 0 (0x0). The thread 0x574 has exited with code 0 (0x0). Detected memory leaks! Dumping objects -> c:\work\MyProject\MyUIthread.cpp(396) : {717} normal block at 0x00C17CA8, 4 bytes long. a CWinThread object at $00C17BF0, 112 bytes long c:\work\MyProject\MyUIthread.cpp(96) : {550} normal block at 0x00C17FC0, 12 bytes long. Data: < > C...

How to invoke another application in menu?
I would like to implement an application where i can run another application by clicking on the menu button. For example, when i click on the button 'notepad' the notepad application will run and i can use it. Hope someone can give me some help to do it. Thanks. Bye! CreateProcess. Or ShellExecute. If you already have a file in hand, ShellExecute is often the easiest to use. joe On Mon, 30 Jun 2003 07:51:19 -0700, "weekeong" <weekeong81@hotmail.com> wrote: >I would like to implement an application where i can run >another application by clicking on the...

Program stops executing
I have an instance such that any VB program will not work on a certain PC. It used to, but now the VBNET2005 generated executable will now not execute. I have tried creating a simple project with just a form on it with Hello World in a textbox and even that will not execute in runtime. There is no question of the framework not being installed because it comes standard in the Windows XP SP2 and I have SP3 installed on the PC. I have uninstalled and reinstalled the DotNet framework and this has NOT resolved the issue. Can anyone please shed some light on this matter for me a...

VBA- Application.Wait?
Does PowerPoint not have "Application.Wait" like Excel? Is there another way to pause code for a few seconds in PPT 2003/2007 while a small bat file runs? -Mel On 3/10/10 2:29 AM, Mel wrote: > Does PowerPoint not have "Application.Wait" like Excel? Is there > another way to pause code for a few seconds in PPT 2003/2007 while a > small bat file runs? > > -Mel From Example 8.4 on my Web site (http://www.PowerfulPowerPoint.com/): Sub Wait() waitTime = 5 Start = Timer While Timer < Start + waitTime DoEvents ...

Execute As
Greetings. I have 2 Databases with 2 different sets of users, and thus 2 different sets of permissions. Certain actions on Database A fires a trigger that executes a stored procedure on database B. If the user in Database A doesn't have permission on Database B, then the procedure fails, and the User gets an error. I have been experimenting with the EXECUTE AS function, but it doesn't seem to work as I had expected. Can anyone give me some tips or point me in the direction of some holiday reading material? Thanks in advance. Matthew Vandermolen Solutions Architecht Worktec...

Job Application
...

Validation and application size
Hi experts, I have a minor problem.... In column D i have a data validation list in each cell. Until now, I had only 100 lines in my application. The size of the application was about 300kb Because i do not know how many lines the user will put in, i have made all cells ranging from D4:D65000 with datavalidation. Now my application is about 1.700kb Is there a way to only have a data validation (dropdownlist) in column D when the user puts something in column B on the same line ? How would i program that in VBA ? Thanks, Pierre -- Message posted via OfficeKB.com http://www.officekb.com/...

How to get the setup program from visual studio?
I write a program using vc6.0,and I put it to a PC that its operation system is win98,and without installing other programs(such as office,visual studio), my application program doesn't run.Then I install MDAC2.8 in this PC,and the program doesn't run too.Finally I run the setup program of visual studio and only select installing Data Access,and then my program can run correctly.I want to know how to get the setup program from visual studio?because I want to make a setup program. use depends to get the list of dlls that your program needs first. to make a setup, i have no experienc...

XL2007: File/Application Close behavior #2
So, for 25 years or whatever, if you clicked on the red "X" in the upper right corner of the window of any Microsoft application, it would close all open files and then close the application itself. And if you wanted to close just the immediate document, you clicked on the "X" at the top of the document's window, not the application's window. On my system (XP) though, XL2007 appears to behave differently. The application window "X" performs the same function as the document window "X" - it just closes the immediate document window. Is there s...

Excel 2007: unusual flicker with Application.ScreenUpdating = True
I have an XL03 application that has been converted to XL07. I have a routine that updates a chart by dynamically changing the data source and labels according to a user's dropdown selection. I turn off ScreenUpdating and when finished turn it back on again. There is an unusual amount of screen flicker, which I have identified as occuring only after I turn on ScreenUpdating. This seems weird and I'm wondering if others have experienced it and whether there's a fix/ workaround. Thanks in advance Paul Martin Melbourne, Australia try application.screenupdating = fa...

Mem Usage increase while while executing dialog box
Dear All, Hope I have posted to the correct topic area. Need some help here. 1. I have created a simple dialog box using Visual Studio C++ 6.0, the dialog box contains an multiline read-only Edit Box, a Start Button and a Stop Button. 2. When the Start Button is clicked, the program will execute and the Edit Box will just print out the following text - "Line XX", where XX is the number 3. Problem is that when the program is executed and using Windows Task Manager to monitor the process, there is a high usage of Memory (ranges from 3636K to as high as 40000K). 4. Question ...

Deleting VBA programs
HELLO I am hoping that someone can help me with this problem. Well it all started when I copied and pasted a small VBA program from the internet. The VBA program was to stop anyone from copying or cutting and pasting any of my work. However this VBA program went to all excel sheets and now I cannot cut or copy by using the the left mouse or the cut/copy in edit. I can however still cut and copy by using control+c/x. I have so far deleted the VBA program plus I have deleted the excel program itself and I have even deleted Microsoft Office and then reloaded it. And still I have the same problem...

Server execution failed
Am trying to play WMV clips. I keep getting Server Execution Failed messages. What's the fix? Thanks. -- James Never mind. Fixed it by running a registry cleaner. Odd. -- James "James Ko" <iamwho@hawaii.rr.com> wrote in message news:uhbKodidKHA.6096@TK2MSFTNGP02.phx.gbl... > Am trying to play WMV clips. I keep getting Server Execution Failed > messages. What's the fix? Thanks. > > -- > James ...

MFC code ... X button at top right of dialog/application no longer works
Hello. I've been modifying someone else's MFC code, and the X button at top right of dialog/application no longer works to close the app. What can I do to get this working again ? Thanks ! Look for OnClose(or OnSysCommand) in dialog/mainframe window and see whats going on there. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "pogo" <pogo@RequestEmailInNewsgroupOnly.com> wrote in message news:2XaMf.25377$UD1.12509@bignews2.bellsouth.net... > Hello. > I've been modifying someone else's MFC code, and the X button at top right > of dialog/application...

From VC++ pro to VC++ 2005?
I'm not a programmer by trade, but have gotten somewhat comfortable with VC++ 6 pro. Is it recommended to upgrade to VC++ 2005? Will VC++ 2005 make it easier for me to make sure that my applications remain compatible with Vista? What is your experience in changing from VC++ 6 to VC++ 2005? Any comments are appreciated. Harald "Harald" <Haraldnospamcollonia@yahoo.com> wrote in message news:NbdJh.11916$Jl.4186@newsread3.news.pas.earthlink.net... > I'm not a programmer by trade, but have gotten somewhat comfortable with > VC++ 6 pro. Is it recommended to...

How to Open another application in powerpoint
Hi All, I want to open on application within my power point slide using Activex. Any idea how can I do that?? Thanks in advance ...

XML Application
We use xml files to denote file configurations for our company. We are now getting to the point where need a browser based method of maintaining and creating the configuration files. I had written a small test app for working with XML in ASP.Net and have found that it is painfully slow and cumbersome. Can anyone give me some suggestions or sample links to articles that would help develop an application of this type? I need to allow the user to create a new configuration xml document and modify them with the usual updates, inserts and deletes of nodes. Thanks, Matt ...

New computer cannot install old Publisher program...
I purchased a Dell computer a few years ago which included Microsoft Office 2000 in the package. That program also included Microsoft Publisher which I used often in our business. My computer crashed a few months ago and it could not be repaired. I lost everything. I have since purchased a Gateway computer. I have tried to install my old Microsoft Publisher from my old computer disk onto the new but it will not except the registration number that I written on a label on the disk. How can I download this? I would really appreciate help in this matter as I can't even open my c...

Updating Form Field During Execution
I have a textbox field on a form in which I enter the number of times to execute a particular loop in my program. If I enter 2000, I would like for the field to change, maybe every 100 executions, to show how many remaining executions there are. I am changing the value (textbox.value = xx) after each 100 executions, but the field on the form does not refresh until all 2000 loops have been executed. Is there some way to accomplish this? -- Bill @ UAMS This is a userform? Try changing your value: me.textbox.value = clng(me.textbox.value) - 100 me.repaint BillCPA wrote: >...

How do I protect Visual Basic for Application Code
I have noticed that MS's templates and other Excel files received from other sources needs a password to open the VBA source code. I have been unable to find any assistance from OLH or figure it out on m,y own how to protect my VBA source code. Any help appreciated. Open excel open your workbook hit alt-f11 (to get to the vbe) hit ctrl-r (to see the project explorer) with your project selected in the project explorer Tools VBAProject Properties Protection tab. Zagrijs Venter wrote: > > I have noticed that MS's templates and other Excel files received from other > so...

Execute an executable program.
How can I in code (VB.NET 2008) execute another executable program ? Thanks :) On Mar 26, 11:21=A0am, "Mr. X." <nospam@nospam_please.com> wrote: > How can I in code (VB.NET 2008) execute another executable program ? > > Thanks :) Process.Start("path_of_exe") http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.as= px is what you want. HTH, Onur G=FCzel Am 26.03.2010 10:21, schrieb Mr. X.: > How can I in code (VB.NET 2008) execute another executable program ? 'System.Diagnostics.Process.Start' or &#...