Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 4th, 2008, 6:46 AM   #1
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
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
hbe02 is offline   Reply With Quote
Old Apr 4th, 2008, 7:57 AM   #2
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
Re: inter-program communication

How about using files(e.g. xml,db..etc) or the network.
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Apr 4th, 2008, 9:45 AM   #3
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
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.
hbe02 is offline   Reply With Quote
Old Apr 4th, 2008, 10:09 AM   #4
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3 Jimbo is on a distinguished road
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>
Jimbo is offline   Reply With Quote
Old Apr 4th, 2008, 8:11 PM   #5
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,033
Rep Power: 5 lectricpharaoh will become famous soon enough
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.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Apr 5th, 2008, 11:18 AM   #6
hbe02
Hobbyist Programmer
 
hbe02's Avatar
 
Join Date: Mar 2006
Location: Lebanon
Posts: 148
Rep Power: 3 hbe02 is on a distinguished road
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!
hbe02 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC