View Full Version : get access to global shared memory win32

3rd November 2011, 20:23
I have created a shared memory in an external application with CreateFileMapping,MapViewOfFile and so on. It is working, I have access from different applications (Visual Studio C++ Console, Matlab mexw32 files) and I can see it using WinObj-Sysinternals within "BaseNamedObjects".

My problem: I can not access this shared memory with OpenFileMapping from my qt application (qtcreator, qt 4.7.4, MSVC C++ Compiler 9.0 x86).

I can also create a shared memory within the qt application and can access it, but it is not listed within "BaseNamedObjects" in WinObj.

It seems qt is working in a different namespace.

What can I do?

Thanks a lot.

3rd November 2011, 23:32
from Qt Docs

Warning: QSharedMemory changes the key in a Qt-specific way. It is therefore currently not possible to use the shared memory of non-Qt applications with QSharedMemory.

4th November 2011, 00:09
The non-Qt application shared memory must still be accessible through exactly the same Windows APIs as the other application is using to establish it though.

4th November 2011, 11:10
I am not using QSharedMemory but calling an external routine which is using CreateFileMapping,MapViewOfFile... directly. I am using the exact same source for both sides, but it is still not working.