Memory data sharing between two applications

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
papillon68
Experienced Solver
Experienced Solver
Posts: 73
Joined: Tue Nov 06, 2007 11:19 pm

Memory data sharing between two applications

Post by papillon68 » Mon Apr 15, 2019 10:17 am

Hello folks, I'm looking to any suggestion or hints about this particular scenario.
I have a WxWidgets-base application, and a Qt-based application. What I need to do it's exchanging data between the two, so that basically the apps listen for data change and synchronize.
Any suggestion? Thanks!
Windows 10, MS VC++ 2015 (vc140), WxWidgets 3.11

User avatar
doublemax
Moderator
Moderator
Posts: 14100
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Memory data sharing between two applications

Post by doublemax » Mon Apr 15, 2019 11:18 am

There is nothing for this in wxWidgets.

https://www.boost.org/doc/libs/1_50_0/d ... esses.html
Use the source, Luke!

User avatar
T-Rex
Moderator
Moderator
Posts: 1182
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Re: Memory data sharing between two applications

Post by T-Rex » Mon Apr 15, 2019 12:49 pm

You could check wxConnection and related classes and their implementation and implement something similar at Qt app's side (in general, you will need to put the header with signature at the beginning of the message).

Nunki
I live to help wx-kind
I live to help wx-kind
Posts: 199
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: Memory data sharing between two applications

Post by Nunki » Thu Apr 18, 2019 7:18 pm

Hi pappilon68,
Having two applications exchanging data would be by means of a database like Postgresql. Straightforward, reliable and possible with a minimum of extra work. Performance should normally be sufficient. A plus may also be that this solution works both inside one server as between multiple servers. e.g. ths wxWidgets running on a windows machine and the Qt running on a linux machine.
A more direct approach would be a direct link between the two applications by means of sockets. That would mean programming a server, client and drawing your own message structure.
A third option that may be a very good solution when in need of perfromance is building a server (a bit like apache) waiting for client connections. With the implementation of what is a bit like 'data queues' on the AS/400. both applications drop messages in each others mailbox. This way the server may service many clients.

Maybe a good book for you would be 'UNIX network programming' by W.Richard Stevens. specifically volue 2 'interprocess communication'. Though being for unix this book serves you well for other operating systems.

Have fun,
with regards,
Nunki

papillon68
Experienced Solver
Experienced Solver
Posts: 73
Joined: Tue Nov 06, 2007 11:19 pm

Re: Memory data sharing between two applications

Post by papillon68 » Sat Apr 20, 2019 1:56 pm

Thanks for the pointers, really appreciated!
Windows 10, MS VC++ 2015 (vc140), WxWidgets 3.11

alys666
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 245
Joined: Tue Oct 18, 2016 2:31 pm

Re: Memory data sharing between two applications

Post by alys666 » Sun Apr 21, 2019 1:17 am

best ways are sockets and pipes. as mentioned, learn the topic - inter-process communication.
ubuntu 16.04, wxWidgets 3.0.4

Post Reply