Solved

Call my program itself.

Posted on 1999-01-25
1
164 Views
Last Modified: 2010-04-02
What is the difference between print banding and
non-banding ? Which is the better ?
What is the difference between programming in lazer printer
and HP Deskjet (670C)printer ?
How can I return the program after I sent WM_CLOSE to it( that means I want to close my program and after that it can
call itself again), like this :
 My program include 2 modun A and B. At the beginning, A can run or call B. If A call B, B is ruuning and when B finished it auto close the program and call again to the beginning (A run) . User only can close program only they close A.



0
Comment
Question by:longlong
1 Comment
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 1185128
you can use one of these...

WinExec()
ShellExecute()
CreateProcess()

then when you execute app B it would wait and see when A is gonna close down. When this happens your B programs does some stuff and runs back app A, and the process can continue on and on...

YOu can use WaitForSingleObject() so your program can wait until the other closes down...

Hope this helps...

-Viktor
--Ivanov
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

820 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