Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Comunication between software

Comunication between software

Scheduled Pinned Locked Moved C / C++ / MFC
11 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N NorGUI

    I would like just ask what it is the best way to transfert data between software. The is many way , DCOM, DDE, or TCPIP connection . The software that I will use have to run on the same PC. I know that it is possible to used TCPIP but I do not know if it is a good solution ! I have never used the DCOM ! Thank you. AutreChien

    J Offline
    J Offline
    Jun Du
    wrote on last edited by
    #2

    Memory-mapped file (MMF) is the lowest level of all the IPCs you described. It is also the fastest. The rest all has more or less overhead added. On Windows, MMF is also vaguely called "shared memory". Best, Jun

    E 1 Reply Last reply
    0
    • J Jun Du

      Memory-mapped file (MMF) is the lowest level of all the IPCs you described. It is also the fastest. The rest all has more or less overhead added. On Windows, MMF is also vaguely called "shared memory". Best, Jun

      E Offline
      E Offline
      earl
      wrote on last edited by
      #3

      However, TCP has the very nice benefit that should you ever want to move one of these programs to a separate computer, you've done most of the work already. earl

      1 Reply Last reply
      0
      • N NorGUI

        I would like just ask what it is the best way to transfert data between software. The is many way , DCOM, DDE, or TCPIP connection . The software that I will use have to run on the same PC. I know that it is possible to used TCPIP but I do not know if it is a good solution ! I have never used the DCOM ! Thank you. AutreChien

        L Offline
        L Offline
        ldaoust
        wrote on last edited by
        #4

        Maybe you need to clarify just a few things: What kind of data you want to exchange ? How often will data be exchanged ? Are you sure the application will ALWAYS have to run on the same PC ? Will you need the code to be portable ? On the same PC: - You can use WM_COPYDATA message. - You can use the clipboard to exchange data. This is very easy. RegisterClipboardFormat will be needed if your data is not text. - Memory map file is easy and efficient. - Shared memory. Article on codeproject[^] - DDE is a bit more complex. Might want to read this[^] - Sockets. Fast and easy at low level. Can be tricky for newcomers. Might want to use a class provided on this site. Many articles on this site. If the data will need to be exchanged from different computers, then sockets will be the way to go. If you can use a known protocol, HTTP for example, then use it. Again, if your not familiar with sockets and protocols, it can be a lot of work and tricky to implement, so use an existing class. my five cents.


        Louis * google is your friend *

        N 1 Reply Last reply
        0
        • L ldaoust

          Maybe you need to clarify just a few things: What kind of data you want to exchange ? How often will data be exchanged ? Are you sure the application will ALWAYS have to run on the same PC ? Will you need the code to be portable ? On the same PC: - You can use WM_COPYDATA message. - You can use the clipboard to exchange data. This is very easy. RegisterClipboardFormat will be needed if your data is not text. - Memory map file is easy and efficient. - Shared memory. Article on codeproject[^] - DDE is a bit more complex. Might want to read this[^] - Sockets. Fast and easy at low level. Can be tricky for newcomers. Might want to use a class provided on this site. Many articles on this site. If the data will need to be exchanged from different computers, then sockets will be the way to go. If you can use a known protocol, HTTP for example, then use it. Again, if your not familiar with sockets and protocols, it can be a lot of work and tricky to implement, so use an existing class. my five cents.


          Louis * google is your friend *

          N Offline
          N Offline
          NorGUI
          wrote on last edited by
          #5

          What kind of data you want to exchange ? -char or container that will contain a structur of data. How often will data be exchanged ? - 2-10 times per hours. Are you sure the application will ALWAYS have to run on the same PC ? - Actualy it will be only of one computer but it is possible that change (not for this project!). Will you need the code to be portable ? -No. When you say socket it is conection using TCPIP ? In your list there is not the DCOM, it is from you side not a possible solution ? Thank for your help. AutreChien

          E L 2 Replies Last reply
          0
          • N NorGUI

            What kind of data you want to exchange ? -char or container that will contain a structur of data. How often will data be exchanged ? - 2-10 times per hours. Are you sure the application will ALWAYS have to run on the same PC ? - Actualy it will be only of one computer but it is possible that change (not for this project!). Will you need the code to be portable ? -No. When you say socket it is conection using TCPIP ? In your list there is not the DCOM, it is from you side not a possible solution ? Thank for your help. AutreChien

            E Offline
            E Offline
            earl
            wrote on last edited by
            #6

            sockets is the name of the interface/library usually used to to TCP or UDP communications. earl

            1 Reply Last reply
            0
            • N NorGUI

              What kind of data you want to exchange ? -char or container that will contain a structur of data. How often will data be exchanged ? - 2-10 times per hours. Are you sure the application will ALWAYS have to run on the same PC ? - Actualy it will be only of one computer but it is possible that change (not for this project!). Will you need the code to be portable ? -No. When you say socket it is conection using TCPIP ? In your list there is not the DCOM, it is from you side not a possible solution ? Thank for your help. AutreChien

              L Offline
              L Offline
              ldaoust
              wrote on last edited by
              #7

              Salut AutreChien,

              NorGUI wrote:

              When you say socket it is conection using TCPIP ?

              Sockets are used to communicate using TCP or UDP protocols. When you say TCP/IP it means using TCP (Transmision Control Protocol) of the IP (Internet protocol) suite. It is the same thing.

              NorGUI wrote:

              In your list there is not the DCOM, it is from you side not a possible solution ?

              I am not an expert with COM, but here's what I know. 1) DCOM is an extension to COM that allow communication accross a network. In your case, on the same PC you only need COM. 2) COM is an object model. I think to use that with your applications, you would create a project to create that object. Then your applications will have to use this object, that will need to be installed (registered) on the PC. It will give you an object that you can use from different applications, independent of their programming model. More info on COM[^]: 3) Where I work, we have created ActiveX controls to be used on IIS servers to access different resources. It works fine, but can be somewhat complex and sometimes hard to debug. I think ActiveX closely resemble COM. 4) This is all very Windows. Not portable. 5) If your application will not be exchanging data more then you mention and wont exchange across different PCs and you are already familiar with COM, then it may be the right choice for you.


              Louis * google is your friend *

              E N 2 Replies Last reply
              0
              • L ldaoust

                Salut AutreChien,

                NorGUI wrote:

                When you say socket it is conection using TCPIP ?

                Sockets are used to communicate using TCP or UDP protocols. When you say TCP/IP it means using TCP (Transmision Control Protocol) of the IP (Internet protocol) suite. It is the same thing.

                NorGUI wrote:

                In your list there is not the DCOM, it is from you side not a possible solution ?

                I am not an expert with COM, but here's what I know. 1) DCOM is an extension to COM that allow communication accross a network. In your case, on the same PC you only need COM. 2) COM is an object model. I think to use that with your applications, you would create a project to create that object. Then your applications will have to use this object, that will need to be installed (registered) on the PC. It will give you an object that you can use from different applications, independent of their programming model. More info on COM[^]: 3) Where I work, we have created ActiveX controls to be used on IIS servers to access different resources. It works fine, but can be somewhat complex and sometimes hard to debug. I think ActiveX closely resemble COM. 4) This is all very Windows. Not portable. 5) If your application will not be exchanging data more then you mention and wont exchange across different PCs and you are already familiar with COM, then it may be the right choice for you.


                Louis * google is your friend *

                E Offline
                E Offline
                earl
                wrote on last edited by
                #8

                An ActiveX control is a COM object that implements a particular set of interfaces. earl

                1 Reply Last reply
                0
                • N NorGUI

                  I would like just ask what it is the best way to transfert data between software. The is many way , DCOM, DDE, or TCPIP connection . The software that I will use have to run on the same PC. I know that it is possible to used TCPIP but I do not know if it is a good solution ! I have never used the DCOM ! Thank you. AutreChien

                  J Offline
                  J Offline
                  Joe Woodbury
                  wrote on last edited by
                  #9

                  I would encapsulate the code in a class so that the actual sharing mechanism would be hidden from the program. For the short term, I'd recommend using shared memory. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

                  1 Reply Last reply
                  0
                  • L ldaoust

                    Salut AutreChien,

                    NorGUI wrote:

                    When you say socket it is conection using TCPIP ?

                    Sockets are used to communicate using TCP or UDP protocols. When you say TCP/IP it means using TCP (Transmision Control Protocol) of the IP (Internet protocol) suite. It is the same thing.

                    NorGUI wrote:

                    In your list there is not the DCOM, it is from you side not a possible solution ?

                    I am not an expert with COM, but here's what I know. 1) DCOM is an extension to COM that allow communication accross a network. In your case, on the same PC you only need COM. 2) COM is an object model. I think to use that with your applications, you would create a project to create that object. Then your applications will have to use this object, that will need to be installed (registered) on the PC. It will give you an object that you can use from different applications, independent of their programming model. More info on COM[^]: 3) Where I work, we have created ActiveX controls to be used on IIS servers to access different resources. It works fine, but can be somewhat complex and sometimes hard to debug. I think ActiveX closely resemble COM. 4) This is all very Windows. Not portable. 5) If your application will not be exchanging data more then you mention and wont exchange across different PCs and you are already familiar with COM, then it may be the right choice for you.


                    Louis * google is your friend *

                    N Offline
                    N Offline
                    NorGUI
                    wrote on last edited by
                    #10

                    Salut Louis, Point 5) I do not have any experience with COM implementation and I do not know if it is easy to start and have operationel COM ? And if I start with COM and I will comunicate between application there not on the same PC I will need to switch to DCOM and it will be again a lot of works, I think. If I start with TCP/UDP it will possible to switch without any problem in any time to comunicate between aplication running on many PC. I used TCP with IP connection but I do not know how to use TCP without IP (for sample when I will comunicate between aplication running ion the same PC and TCP protocol). Thank you ! :) AutreChien

                    L 1 Reply Last reply
                    0
                    • N NorGUI

                      Salut Louis, Point 5) I do not have any experience with COM implementation and I do not know if it is easy to start and have operationel COM ? And if I start with COM and I will comunicate between application there not on the same PC I will need to switch to DCOM and it will be again a lot of works, I think. If I start with TCP/UDP it will possible to switch without any problem in any time to comunicate between aplication running on many PC. I used TCP with IP connection but I do not know how to use TCP without IP (for sample when I will comunicate between aplication running ion the same PC and TCP protocol). Thank you ! :) AutreChien

                      L Offline
                      L Offline
                      ldaoust
                      wrote on last edited by
                      #11

                      Salut AutreChien, To communicate using TCP (TCP/IP is the same thing) you will be using sockets. You create a socket for TCP by specifying SOCK_STREAM as the familly (type). All the logic for transferring packets with this protocol is handled by the socket library so you dont need to worry about that. You then connect to a remote or local address (you probably will be using 'localhost' as the address for the local PC), then you send and receive data using the proper functions (send and recv) and giving a buffer with data to send (or buffer to receive data). It is traitforward at the base. If you already used sockets then you already know how to do it. If not, you will need to read about sockets, there is a lot of info about that on the net and on this website. An advice to you, do not use MFC sockets, the CSocket class, it is not very efficient. CAsyncSocket is acceptable since it does not have a lot of overhead built in it. Depending on your knowledge of sockets, you can go with basic socket object and create your own class or find a class here on CodeProject, just make sure it is not a class derived from CSocket. If you are using Visual C++, look up the CAsyncSocket in the help (in MSDN) and you should find a sample called CHATSRVR (Chat server) it probaly will be a good starting point for what you want to do. Here's a good reference[^] for Windows sockets. Bonne chance et joyeuse programmation :)


                      Louis * google is your friend *

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups