Results 1 to 4 of 4

Thread: get access to global shared memory win32

  1. #1
    Join Date
    Oct 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default get access to global shared memory win32

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: get access to global shared memory win32

    HI,
    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.
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: get access to global shared memory win32

    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.

  4. #4
    Join Date
    Oct 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: get access to global shared memory win32

    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.
    Last edited by FriedrichIWM; 4th November 2011 at 10:46.

Similar Threads

  1. QMake Shared/Global/Inherited Variables between projects
    By Sogartar in forum Qt Tools
    Replies: 7
    Last Post: 23rd January 2020, 12:36
  2. shared memory - the right way to do it
    By fearu in forum Newbie
    Replies: 0
    Last Post: 26th October 2011, 23:46
  3. Does Qt support shared memory ?
    By Shawn in forum Qt Programming
    Replies: 11
    Last Post: 3rd November 2009, 17:07
  4. QT shared memory
    By sweetsubha2020 in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2009, 05:30
  5. How to clear shared memory?
    By THRESHE in forum Qt Programming
    Replies: 4
    Last Post: 22nd May 2008, 18:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.