|
-
Mar 6th, 2002, 06:14 PM
#1
Thread Starter
Fanatic Member
Making 2 programs directly communicate
Is it possible to establish a connectie between 2 programs so they can exchange data??
-
Mar 6th, 2002, 09:19 PM
#2
Fanatic Member
Re: Making 2 programs directly communicate
Originally posted by jacsoft
Is it possible to establish a connectie between 2 programs so they can exchange data??
When I looked into this a few weeks back the best I could find was to have the apps exchange data through bollean variables or others using or "sharing" same registry keys or ini files.
Basically, leaving each other messages. Actually I'm working on an app right now that runs in "stealth" mode (so-to-speak) which uses onother app to load it, close it etc. using this method both apps can be renamed for security purpose.
I'll try to find the links I had back then if you want.
Hope this helps?
-
Mar 6th, 2002, 09:34 PM
#3
The most common ways are:
1) Use the SendMessage API to send realtime messages and data between the apps. Only works if they are both running on the same machine.
2) The shared file/registry leave a message approach that daydee was talking about.
3) Use a shared ActiveX Exe to exchange data in realtime, may work across a network also.
You'll probably want to go with or look at option 1 first as that is probably the easiest with the least over head (if you need realtime) otherwise the shared file thing works great.
-
Mar 7th, 2002, 01:05 AM
#4
Hyperactive Member
An idea: you can share data between your prog using a file where they talk to each other. Example:
Prog 1 reads what prog 2 has written on line 1 and answer prog 1 on line 2. This is just a thought, why shouldnt it work??
-
Mar 7th, 2002, 04:13 AM
#5
Frenzied Member
You could do it as per this article....
-
Mar 7th, 2002, 01:57 PM
#6
Thread Starter
Fanatic Member
I will check it out
I will check some ideas only I don't want to use files or registery keys cause then I need to have timers to check each time if something changes and that cost to much resources. So I will check it out and will come back on this later
-
Mar 7th, 2002, 04:10 PM
#7
Frenzied Member
-
Mar 7th, 2002, 05:25 PM
#8
Frenzied Member
-
Mar 8th, 2002, 03:49 PM
#9
Thread Starter
Fanatic Member
ANy samples?
Has anyone got a good sample to check, cause if I have to figure it all out it would take ages. SO ???
-
Mar 8th, 2002, 06:11 PM
#10
New Member
-
Mar 8th, 2002, 06:29 PM
#11
-
Mar 8th, 2002, 06:31 PM
#12
You can use an ActiveX EXE (Out of process server) to communicate between applications,
here's a Link to an example I posted which outlines this functionality.
-
Mar 8th, 2002, 06:36 PM
#13
An idea - You can use the Winsock control to exchange data.
Connect the 2 Winsocks to the same comp (If not network connect to 127.0.0.1) and to a specific Port and then u can 'talk' with the 2 apps.
-
Mar 8th, 2002, 08:45 PM
#14
Frenzied Member
Originally posted by Aaron Young
You can use an ActiveX EXE (Out of process server) to communicate between applications,
here's a Link to an example I posted which outlines this functionality.
i love this little example, but i cannot figure out how it can be used in my mp3 player... what i want to do is make it so when you open an mp3 file, instead of opening another instance (which screws up MCI causing entire strings of errors) it will tell my program to play the mp3 file... im gunna keep screwing w/ the code though, and see if i can get it to work.
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Mar 8th, 2002, 11:11 PM
#15
You can also use Pipes. Take a look in MSDN.
Z.
-
Mar 9th, 2002, 01:07 AM
#16
Originally posted by Skitchen8
i love this little example, but i cannot figure out how it can be used in my mp3 player... what i want to do is make it so when you open an mp3 file, instead of opening another instance (which screws up MCI causing entire strings of errors) it will tell my program to play the mp3 file... im gunna keep screwing w/ the code though, and see if i can get it to work.
That's pretty much what my example is doing, instead of starting a 2nd instance of the EXE, it's passing the files from what would have been the 2nd instance to the 1st instance which adds it/them to the end of it's list.
-
Mar 9th, 2002, 02:24 AM
#17
New Member
Nice example Aaron.
Just another idea ... if the apps are running on the same pc, you could set a textbox to receive data. The sending app finds the texbox with findwindow and then sends data to it. The receiving app can use the standard texbox events to react to the data being received.
-
Mar 9th, 2002, 02:45 AM
#18
Frenzied Member
Originally posted by Aaron Young
That's pretty much what my example is doing, instead of starting a 2nd instance of the EXE, it's passing the files from what would have been the 2nd instance to the 1st instance which adds it/them to the end of it's list.
prolly just my stupidity but i couldn't understand it... i tried to do it, but it won't let me reference an exe file in my projects (it always gets errors... my computer hates me!!!!!)
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|