Two programs communicating locally.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Two programs communicating locally.

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    2

    Two programs communicating locally.

    I came to codeguru just to browse early in my C programming career. I programmed mainly on Linux but I want to move to windows. I'm definitely not the strongest programmer, but I like the challenge sometimes. I'm not looking for COMPLETE answers here, just directions and pointers.

    I want two separate programs to run on windows, very simple programs. These programs will communicate locally back and forth by sending irrelevant (at first) data. I want them to be able to detect and send data back and forth. Looking around, I've decided to use sockets. I am new to sockets ESPECIALLY on windows. Can anyone point me to a good tutorial or give me some info to look at that would help me in this programming endeavor.

    I have been following these forums for a few months now. This is my first post, so I may have messed up somewhere, but this community seems great. Thanks guys!

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,283

    Re: Two programs communicating locally.

    Well, sockets are good for IPC but using them to communicate locally (on the same PC) would be an overhead.
    Perhaps simple posting/sending user defined messages with PostMessage/SendMessage will be easier to implement?
    Or using WM_COPYDATA message?
    Another possibility is using File Mapping. Or just a Clipboard...

    Have a look at:
    MSDN: Interprocess Communications
    Using WM_COPYDATA
    An MFC Asynchronous Socket Example Done Right
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,266

    Re: Two programs communicating locally.

    I would be looking at using pipes? These are quite easy to set up and use for IPC.

    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  4. #4
    Join Date
    Apr 2013
    Posts
    2

    Re: Two programs communicating locally.

    Yeah, I want to do it with sockets as I may and probably will expand. The references link will help a great deal. If you guys have any pointers or further references, please let me know!

  5. #5
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,266

    Re: Two programs communicating locally.

    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center