How to run another .exe program on a button click

I have written a stand alone .exe program the performs some tasks.  I then 
have another program that does something completely different, however in 
this second program when I press a button on the dialog box, I would like to 
execute the .exe program so that it can do its thing.  How can I do this? 
Is there a way also for me to pass information from the .exe program to my 
other dialog based program?  As the .exe program is running, I'd like to 
update my dialog so that the user can see what is happening in real-time.

-- 
_____________________
www.maduckgames.com
www.marek-knows.com 


0
mmarek (15)
10/15/2005 9:55:12 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
342 Views

Similar Articles

[PageSpeed] 52

ShellExecute should do it. Other options include CreateProcess.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Marek Krzeminski" <mmarek@rogers.com> wrote in message
news:l_KdnWpzH_-ZT83enZ2dnUVZ_tOdnZ2d@rogers.com...
> I have written a stand alone .exe program the performs some tasks.  I then
> have another program that does something completely different, however in
> this second program when I press a button on the dialog box, I would like
to
> execute the .exe program so that it can do its thing.  How can I do this?
> Is there a way also for me to pass information from the .exe program to my
> other dialog based program?  As the .exe program is running, I'd like to
> update my dialog so that the user can see what is happening in real-time.
>
> --
> _____________________
> www.maduckgames.com
> www.marek-knows.com
>
>


0
ajaykalra (6842)
10/15/2005 12:23:26 PM
Marek Krzeminski wrote:

> I have written a stand alone .exe program the performs some tasks.  I then 
> have another program that does something completely different, however in 
> this second program when I press a button on the dialog box, I would like to 
> execute the .exe program so that it can do its thing.  How can I do this? 
> Is there a way also for me to pass information from the .exe program to my 
> other dialog based program?  As the .exe program is running, I'd like to 
> update my dialog so that the user can see what is happening in real-time.
> 

You can call CreateProcess to execute a second program, and you can even 
pass command line arguments to the program through this API.

There are many ways to pass information between two programs.  See 
"Interprocess Communications" in MSDN to review the options.  Perhaps 
the simplest way is ::SendMessage(hwnd, WM_COPYDATA, ...).

-- 
Scott McPhillips [VC++ MVP]

0
Scott
10/15/2005 1:21:20 PM
Reply:

Similar Artilces:

enter data in 1 cell and produce a number in another cell
I am trying to set up a form for co-workers with limited computer skills. In cell "A" the employee would enter a name and I need to have a corresponding number appear in another cell. As the form is used for legal documentation, the corresponding number must be accurate and since the numbers are long, we are trying to avoid errors upfront. Any assistance would be appreciated. See if this helps: http://contextures.com/xlFunctions02.html -- Biff Microsoft Excel MVP "Towboat Girl" <Towboat Girl@discussions.microsoft.com> wrote in message ne...

Need only one DLL instance to run...
Hi all, 1: if two apps load the same DLL - LoadLibrary(...) - system will create to different instance of the DLL... Now, in my DLL i've a CList and i need it to be visible to all instance and all apps!!!! Is there a way!? 2: I need the dll to remain loaded till machine reboot!!! Is it possible!? Thanks Ale >if two apps load the same DLL - LoadLibrary(...) - system will create to >different instance of the DLL... >Now, in my DLL i've a CList and i need it to be visible to all instance and >all apps!!!! > >Is there a way!? It'll be difficult to share a ...

credentials to run this report are not stored
Hi all, I'm getting this problem when I try and create a timed subscription. Error: ...credentials to run this report are not stored..... ok I created another folder under the same folder where I'm having this problem. loaded the report and I have no problem. I even moved the current folder with that report in it. Creted another folder with the same name and still the same problem with that named folder. With a different name for the folder I have no problem??? I'm stuck here.. almost all post just talk about storing the credentials, Already done and works...

run time error 10-22-03
I am having a lot of trouble when I open up word I get run time error 52 in VB. I have tried uninstalling word and reinstalling it. WE have tried deleting the macro but still to no avail can someone help me please? ...

Repost: Error running Report in an Access 2003 db from Access 2007
Ok, clarification - ignore the code from my original post, some of the reports do work. The ones that don't are reports that I have being filtered. Here is the code from one of those buttons: Private Sub Ok_Click() On Error GoTo Ok_Click_Err 'using the customer sub form for customer state report to filter the report, clicking ok will open report for selected state Dim stDocName As String Dim stLinkCriteria As String If Not IsNull(Me.Search_Results) Then stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"...

Size of buttons in toolbar
Hi; I want to have different size of buttons in the same toolbar. The default size is 16x15, but I want to have buttons of this size and some other of 32x15. I've read the article in MSJ, but what I understand is that this way tou change all the buttons to the same size. I even downloaded the source and all the buttons have the same size, so, that is not what I'm looking for. Any idea, or anyone who let me know if I'm wrong? Thanks Dalton Could you just resize the other buttons, but leave bitmaps towards one side or the other? Or, could you have two toolbars (one with smal...

xp desktop and start button missin
cant get into to windows even in safe mode have to go to task manager to open anytgin In task mgr,locate "new task",type: cmd In cmd type: CHKDSK C: After,you may want to type: Sfc /Scannow Install xp cd,exit the menu page.Once its thru,remove xp cd,type: CHKDSK C: /F Agree to restart,type: EXIT Restart pc. "jen" wrote: > cant get into to windows even in safe mode have to go to task manager to open > anytgin ...

Automatically run macro
My name is Mike and i have a question about microsoft excel macro's. Attached is a copy of the excel sheet im working on. Below the excel sheet is the macro I built. Some of the cells contain given values and some cells are calculated from formulas. Cell (G4) is my given value...it is related to cell (C32). The point is, I plug a value into cell (C10) and it runs through the rest of the calcs in the other cells and gives me a value to cell (C32). I built a macro that works as a goal seek pretty much. The macro makes cell (C32) equal to cell (G4) and gives me the value for cell (C10). I wan...

Where is PushPrinterConnections.exe
Deploying a new 2008 R2 server and want to deploy some printer via GPO. For the life of me I can not find PushPrinterConnections.exe. It is not in the Windows\System32 folder like all the documentation indicates. What am I missing? Rob It's not included with R2. Pick up the 32bit version from the download center . This will also work for x64 2003 clients http://www.microsoft.com/downloads/details.aspx?familyid=8F7DF3A5-E738-44B4-91EB-4907511F87C6&displaylang=en pmcmgmt.exe Extract on an XP machine -- Alan Morris Windows Printing Team Search the ...

Appointment acceptance going to another user
Hi, While a staff member was away on maternity leave, I gave her co-worker rights to her Mailbox allowing her to open it in her Outlook and send on behalf of etc. Since the maternity leave finished I have removed all the rights I setup but one issue remains. When the maternity leave staff member makes a new appointment and invites participants, the co-worker receives a copy of the acceptance by invited staff members. The co-worker doesn't receive any other mail addressed to the maternity leave person nor the appointment itself, just the appointment acceptances. Does anyone know w...

Excel Continuous Running Total
I posted a message earlier and have received a partial solution. I want to keep track of how much stock prices go up or down with a running total of how much they go up or down over several days until the direction changes. For example, if price go up 10 on Mon, 20 on Tues, 30 on Thurs and down 10 on Fri I want my running total column to show a positive number of 60 and then a red number of 10 and continue adding the amount of the total of the down days until the market shows an up day. The formula I am now using total the first and second day but does not do a running total count if t...

display changing label caption on form as sub runs w/o screen flic
let's say i have this routine Sub Test label1.caption = "Starting ... " 'do events label1.caption = "Getting there ... " 'do events label1.caption = "Finished! ... " End Sub on my form, i have label1 right in the middle what happens is sometimes the message will change, and then sometimes it wont, or it will show the first one, skip the second and jump to the third etc etc etc so it is inconsistent. is there a way to make sure the label caption displays consistently, on time, wh...

program terminates unexpectedly
Version: 2004 Operating System: Mac OS X 10.3 (Panther) Processor: Power PC my wife has a LOT of word documents and powerpoint presentations that she created on her computer using office for mac 2004. now whenever she tries to open one of them, the program starts up then terminates itself. if she opens the program first then tries to open the file, it attempts to open then terminates the program. if you open the program then create a new file it terminates when you try to save it. it was working one day and then it wasn't. Hmm....let's work on Word first--try the standard troublesho...

Exchange 2k3 Recovery in another h/w
Friends Need your help guys!,, Is there any way i can restore exchange2003 in another h/w with same os? Existing exchange server name :osiExchange OS :Windows 2003 Standerd SP1. Domain member :osiExchnage.osi.local New H/w I hv installed Windows2003 Sp1 and joined to my existing domain ! do i need to keep the same hostname for new server? pls heelp me out by steps and advises Best Regards, On 27 Jan 2007 21:01:14 -0800, "Vamsi" <konasanimurali@gmail.com> wrote: >Friends > >Need your help gu...

Money 2002 will not run
I had been using Money 2002 for approx. 3 yrs on my home pc (Dell Dim 2100, XP Home Ed. w/SP2). Last year, it simply would not launch. No error message, no splash screen, no app opening, no process listed in Task Manager. Just.... nothing.... The only change that was made to the system since M2k2 last ran was upgrading my a/v solution from Trend Micro PC-Cillin to TM Internet Security. I have tried disabling every aspect of the Internet Security product, as well as completely un-installing the app, and then attempting to run Money, but the same thing (nothing) happens. I was considerin...

Re: Workflow just wont run automatically, i have to run them manually
Yes, but i realized what i was doing wrong. I assumed [bad idea] that if i create a case and hit Save & Close the first time, taht the rule will run. In order for the rule to run automatically, it has to be Save, once it saves it, then Save & Close. Thanks for your reply. "Hi, Did you check the workflow monitor to see if the rules get triggered correctly and complete sucessfully ? Have a nice day, St=E9phane Dorrekens " --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://...

Another Bug ?
Hi Apologies if you people already know this - but I was asked a question by someone I cannot answer. The person was setting a conditional format too show values >= 0.03, and he have the following calculation in to arrive at this value - but did not format the cell as the condition was not true ??? Enter 12.5 to A1 Enter 12.47 to B1 Enter = ABS(A1-B1) to C1 the answer is 0.03 - but if you expand the decimal places it isn't !! It also doesnt work with 6.5-6.47, 24.5-24.47........I havent gone any further because I am horrified :-( Any suggestions or advice would be gratefully recei...

How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class?
Hi! I have developed both a Web Service and a client application, and they work fine. All classes used in the Web Service interface are declared in an assembly named Entities, that is referenced both in the Web Service and the client application. The problem is that the automatically-generated Web Service proxy class creates new classes instead of referencing the original classes. This way, if I add a method to any of the classes in the Entities assembly, that functionality isn't available in the client application, because the proxy-generated classes are static snapshots of the server...

Outlook Still Running
I am running XP Pro with Office 2003 Pro and sometimes when I exit out of Outlook, Outlook.exe and Winword.exe stay as processes still running. Does anyone else have this problem and what can do to make sure this does not happen? Thanks for your help -- Neil Remove ABCD from Email address to reply <neil154ABCD@earthlink.net> wrote: > I am running XP Pro with Office 2003 Pro and sometimes when I exit > out of Outlook, Outlook.exe and Winword.exe stay as processes still > running. Does anyone else have this problem and what can do to make > sure this does not happ...

another for the experts
I have now figured out my VLOOKUP problem, so let me proceed with my troubles. I have a sheett of data that represents the entire human genome, organized in ascending order by chromosome. The list is around 9500 rows, and consists of 9 columns. The first is always going to be my x series (the whole point of this is to make a dynamic scatter plot), and each subsequent column is a log2 value, for 1 of 8 individual data sets, which represent my y series. I know how to keep the x series constant, and choose which y series i want via a combo box and linked cell, with the help of an offset...

Very strange problems while running Great Plains on workstations
I notice that a few workstations in an office I support are having problems when they run Great Plains. Excel, Outlook, Word and Dynamics.exe are showing in the Application event log as being Hanging or Faulting. I also see Fault Bucket errors, but when I search online I cannot find any information online. Here is one of the Fault Bucket errors: 3:15:35 pm 28-Sep-06 Application Hang None 1001 N/A Fault bucket 296734104. Also, these workstations are experiencing problems printing PDF files. Has anyone out there seen this behavior and if so, how can these problems be fixed? Thank you, ...

Another Rejection of Online Services
Apparently my 2007 Money file is using a date from back in 2005 (must be the date I upgraded to Money 2006) to claim my online services are expired. Closing and reopening the file is of little value since it only avoids the initial expiration notice but still displays the expiration notice in the reminders section cutting off any chance at updating my financial records. Bad timing as the first of the month is just around the corner. Best solution I've received so far has been to completely deconstruct and rebuild my money file. Not a task I relish since my records go back to 1998. I...

Publisher 2000 will not run
I had problems with Publisher 98 not running which we=20 never did solve so I installed office 2000 to see if=20 Publisher 2000 would function. Same problem: The flash=20 screen pops up and then disappears. No program. Microsoft=AE Publisher 2000 Version 6.0 has encountered a=20 problem and needs to close. We are sorry for the=20 inconvenience. Howard, hi again, Have you tried opening Publisher in safe mode? Publisher retains all printer information within its publications. If you can open Publisher in safe mode, either regress or update your printer and video drivers. -- Mary Sauer MS MV...

Macro automatic run at open
Is there a simple way to have a macro automatically started when a workbook is open? Thanks Francesco Francesco, use the workbook open event, like this, Private Sub Workbook_Open() MsgBox "It Works!" End Sub To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is at the top-left of the spreadsheet this will open the VBA editor to the thisworkbook module, then, paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook, now this will run every time you ...

Print Quote Button
We would like our sales people to be able to click the Print button on the Quote screen and have a quotation printed in our quotation format with logo et al. Does anyone know where to go to override the output of the quote button? Is the report developed in Crystal? Has anyone successfully tried to do this? I am also being request to do it for the Sales Order and Invoice forms once I figure out how to do a quote. Regards, GeorgeV You will need to look into the SDK for this. No, it is not using Crystal. Frank Lee Workopia, Inc. >> Other Microsoft CRM Online Forum Resources: ...