Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent and Child Processes

Status
Not open for further replies.

jonathanmb

Technical User
Feb 19, 2003
93
US
This is my first attempt at something like this, and I'd much appreciate any tips on how I should approach the problem.

I'd like to have a main app basically controll everything. This app would spawn children processes. The parent would require no user intervention; I want it to operate only on what is passed to and from the children. When the parent sends information to the child, the user would do something with that information using the child process, and then the child would return a response to the parent when the user is finished. The process would continue until the parent decides to end it all.

Winsock came to mind, but that seems like a big waste. I'm not really sure how to make two applications communicate with each other that reside on the same machine. I guess that's what I'm really trying to figure out with all of this.

-Jonathan
 
Are you trying to make a application
to control another applicaion useing winsock ?
in same machine ?

like
one.exe will control
two.exe something like that
in same machine ?

If so then u need winsock on both applicaion , in same listen port and accept port commands.

i am not clear with your question ,

thanks
 
Winsock is certainly one option, but there are others, each with various pros and cons. Some other options include:

1) Global allocation of a shared block of memory.
2) Use the Windows Messaging API's
3) Communicate thru a file or database on the local machine.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I'd rather not use Winsock because that seems like an inefficient way of doing it, but I'll be leaving that as a possible option.

You're basically right in what I'm trying to do, jonybd. What I'm doing isn't real practicle for the application, but this is really just a learning thing for my own benefit. I'm basically trying to have the parent process trigger something in one of the children by passing the child something that says "hey, it's your turn to do something!" Then the child would do something and report back to the parent what it did and to then give control back over to the parent.

I initially thought API calls would be a good way to go, however, I wasn't sure what I need to be looking into; I think I'll be googling for an API reference tonight to see what I can dig up. In fact, I'd like to take the API approach since I've done very little with API in general.

I'll take a look into the all of the options mentioned above, and hopefully I'll come up with a solid approach. I do thank you all for your suggestions.

-Jonathan
 
Since you'd like to proceed down the API route, you might want to start by looking into the SendMessage and PostMessage APIs Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top