FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Win32 C++ problem





DivineLight
Hi All,

i am having a bit of problems with my windows application programming. I have a program that should run another program after it has exited properly, How can i do that?
Schedule it somewhere?

Because the other program i want to run will not run until i quit my calling program.

Please help me out, im stuck!
AftershockVibe
Well... there are a few things you can do. Firstly, though there is not way to directly call the second program from the first one after it has finished because (obviously) if the program is not running it can't call anything (because it's not running!).

Secondly, why won't the second program run until the "calling" program has finished? ShellExecute() should work just fine or are the programs using exclusive resources?

Thirdly, and to answer your actual question, yes you can schedule programs from within others. You do need to be an administrator though and WMI needs to be enabled on the machine. Basically, you create a task just before your first program exits which will run the other program in one seconds time.
See here: http://msdn2.microsoft.com/en-us/library/aa394601.aspx

Cool
Related topics
call by reference (C++)
Problem with using Dev-C++ Editor
C text
Simple menu written in C - Problem with loop
Programming in C problem
Zmiany w programie nauczania informatyki
Anyone with WinSock C++ experience
Gumki w portfelu/kieszeni
CPU Water Cooling Suggestions:
C++ having a problem.
A Good C/C++ Compiler?
Polskie litery
C++ Using class methods in inline functions? Scope problem?
Czy my Polacy jestesmy tolerancyjni?
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.