INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

HANDLE


PASSWORD
Remember Me
Forgot Password?

Come Join Us!

  • 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!

E-mail*
Handle

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

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...These forums are an excellent source and example of the way people can help each other..."

Geography

Where in the world do Tek-Tips members come from?
Dannybe2 (Programmer)
1 Apr 05 8:39
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
Check Out Our Whitepaper Library. Click Here.
mingis (Programmer)
4 Apr 05 7:14
Read about CreateThread() - is it not what you are trying to do?
Helpful Member!kixix (Programmer)
5 Apr 05 0:24
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)

Start A New Thread

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

Click Here to join Tek-Tips and talk with other members!

Promoting, selling, recruiting and student posting
are not allowed in the forums.
Posting Policies

LINK TO THIS FORUM!
(Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum)
TITLE: Microsoft: Visual C++ Forum at Tek-Tips
URL: http://www.tek-tips.com/threadminder.cfm?pid=116
DESCRIPTION: Microsoft: Visual C++ technical support forum and mutual help system for computer professionals. Selling and recruiting forbidden.