×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Dual Programs?

Dual Programs?

Dual Programs?

(OP)
I have a rather difficult problem I have been struggling with for a while now.

I have two programs which need to run at the same time, but each program needs each other's objects from time to time.

So why not combine them into one big program with a launcher. Firstly I need to send a request to the launcher when the program

icon is clicked on to launch a program which I'm not really sure how to do.

Secondly, I would need to do all the threading to get the programs to run concurrently instead of letting windows do all of that

which would be a lot more simple.

Can anybody venture a solution to any part of this, or an alternative approach?

Thanks,
Dan

RE: Dual Programs?

Read about CreateThread() - is it not what you are trying to do?

RE: Dual Programs?

Not sure exactly what you're trying to do, so the below is a bit on the general side.

When you say "I need to send a request to the launcher when the program icon is clicked on to launch a program" do you mean that on some user action, you want to run a program?
If so, that's really quite simple - use the "exec" family of functions from the C standard library, for example (such as execl or execv)

If you really must have two separate processes talking to each other, then you need some form of Inter-Process Communication (IPC)

there are several solutions
- let the apps communicate over a socket (not very efficient, but pretty easy to do)
- use a named pipe (in windows NT, at least - Linux too, I think)
- if the processes are windows, you can use SendMessage (in the Win32 API), assuming you can get each window's handle (via FindWindow or somesuch)
- use a memory-mapped file
- use a normal file, with some manner of locking (exclusive writes, for example)

there are other types of IPC, these are just the ones that come to mind (searching for Inter Process Communication should be fruitful)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close