sharing Memory between process (visual c++ application and Qt application )
Hi all,
I was wondering if memory could be easily shared between application created within visual c++ environment and Qt ?
i'm already sharing memory between two visual c++ applications using CreateFileMapping and want to use Qt to get data from that shared memory.
In few words, i need to send data from a console c++ application (visual c++) to a Qt application ... whats is the fastest way to achieve that
Best Regards,
Hassenman
Re: sharing Memory between process (visual c++ application and Qt application )
Re: sharing Memory between process (visual c++ application and Qt application )
Quote:
Originally Posted by
zuck
Thanks zuck, i successfully used QSharedMemory between two Qt applications. what i'm looking for is trasferring data from a visual c++ application to a Qt application ...
More explicitly, how to attach the two memory segments ...
In the visual c++ side i'm implementing shared memory using :
Code:
m_hSharedMemoryFile = CreateFileMapping((HANDLE)0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0/*dwMaximumSizeHigh*/,
dwNumberOfBytesToMap/*dwMaximumSizeLow*/,
csName.GetBuffer(0));
And in the Qt side i'm using QSharedMemory. Both methods are working alone. (i.e. data trasfer from visual c++ to visual c++ and from Qt to Qt ) but not from visual c++ to Qt or from Qt to visual c++
I think i'm not using the same mechanism in the 2 sides. (Using FileMapping from visual c++ and semaphre from Qt)
Any ideas ?
Rgards,
Hassen
Re: sharing Memory between process (visual c++ application and Qt application )
See how QSharedMemory is implemented and use the same mechanism in your visual c++ code.