Communication using Shared Memory between VC++ and Qt applications

时光总嘲笑我的痴心妄想 提交于 2020-01-06 20:01:36

问题


I am using FileMapping for implementing shared memory concept in a C++ windows form application and QSharedMemory in Qt application.

I want to read data written by C++ form application using FileMapping technique, in Qt application using QsharedMemory.

Is it possible? If not please suggest appropriate methods to implement this feature.


回答1:


I'm not quite sure of the detail of your implementation, however I would suggest that a better more uniform way to approach this would be by using boost::InterProcess - which provides mechanisms that could be used in both processes and then utilize common code.

http://www.boost.org/doc/libs/1_52_0/doc/html/interprocess/sharedmemorybetweenprocesses.html

The other reason is that the library provides mechanisms for synchronisation and other IPC mechanisms that may be useful in the future.

http://www.boost.org/doc/libs/1_52_0/doc/html/interprocess/synchronization_mechanisms.html



来源:https://stackoverflow.com/questions/13512170/communication-using-shared-memory-between-vc-and-qt-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!