Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Best way to call external functions from a different process

[SOLVED] Best way to call external functions from a different process

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.8k Views
  • 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.
  • R Offline
    R Offline
    rizoritis
    wrote on last edited by
    #1

    Hello,

    I created a basic Qt UI that has buttons. I have an external application that I created in C++ from MSVS2008. I am using QSharedMemory for IPC communication. I have successfully binded the data from my app to the UI and can read the outputs. I am a little bit stuck as to what the best way would be to communicate back to my external application. For example, how would I call a function in my external app once a button is pressed in my GUI?

    Thanks ahead of time!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Using QSharedMemory for that, I can only see some kind of protocol you have to setup between your two processes. Something like command + input values that you other process would parse and act upon.

      If you need something more complex you might want to try the other IPC classes like QLocalSocket/Server.

      There is also Qxt that offers class to communicate signals/slots between two process.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rizoritis
        wrote on last edited by
        #3

        [quote author="SGaist" date="1370355322"]Hi,

        Using QSharedMemory for that, I can only see some kind of protocol you have to setup between your two processes. Something like command + input values that you other process would parse and act upon.

        If you need something more complex you might want to try the other IPC classes like QLocalSocket/Server.

        There is also Qxt that offers class to communicate signals/slots between two process.

        Hope it helps[/quote]

        Should I used two differenct shared memory spaces (1 for input data and 1 for output data) or would it be fine to just use one section of shared memory that I store all my data in?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gimble
          wrote on last edited by
          #4

          The answer is yes.

          Under many scenarios, one QSharedMemory would be fine: in others, you may need two (or more). It all depends on the size, content, protection requirements, etc. of your particular implementation.

          What you have asked is a design question: without knowing all the requirements any answer I might give you would just be a guess.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved