![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
inter-program communication
hi all,
im trying to get 2 programs to communicate with each other. First thing that came to my mind is through some virtual serial port. Would that work? can i open com20 on program 1 and com20 on program 2 and simply say read write ? i would also think that windows would not allow 2 programs to open the same COM port.. thanks :-D |
|
|
|
|
|
#2 | |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 327
Rep Power: 3
![]() |
Re: inter-program communication
How about using files(e.g. xml,db..etc) or the network.
__________________
Quote:
|
|
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
Re: inter-program communication
hey thats a good idea. i can open 2 sockets each on the same port connecting to localhost.
but this must raise some issues with security. but i guess it could be resolved by simply blocking the port your using on the firewall. |
|
|
|
|
|
#4 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 742
Rep Power: 3
![]() |
Re: inter-program communication
Any means of communication will have it's own security ramifications. Files are workable, but possibly less efficient (you need to somehow have a semaphore so they don't write at the same time, etc...). Sockets or named pipes would probably suit you fine, assuming you secure them properly.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#5 |
|
Caffeinated Neural Net
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 889
Rep Power: 4
![]() |
Re: inter-program communication
Sockets would probably be the simplest solution, but another option would be to create a .DLL that mediated communication between two or more programs. Yet another solution is to dispatch messages from one program to another; these will be received and processed in the main message loop. I'm not sure how viable this is for managed code, though it's certainly possible.
__________________
A man's knowledge is like an expanding sphere, the surface corresponding to the boundary between the known and the unknown. As the sphere grows, so does its surface; the more a man learns, the more he realizes how much he does not know. Hence, the most ignorant man thinks he knows it all. - L. Sprague de Camp |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3
![]() |
Re: inter-program communication
Thanks everyone, After giving it some thought, using sockets to comunicate is the best solution.
This also gives me already set-up platform to expand my project from inter-program into a networked program communicating 2 different pc's on a network. its all good. cheers! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| hello, I'd like to write a program for my work. | blake_jl | Community Introductions | 13 | Nov 23rd, 2007 4:31 PM |
| Language display in program | Prm753 | C++ | 3 | May 30th, 2006 5:45 PM |
| Creating a program to test a program | sixstringartist | C | 8 | Jan 21st, 2006 1:15 PM |
| move program console window back | badbasser98 | C++ | 21 | Oct 18th, 2005 2:02 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 4:12 PM |