Results 1 to 12 of 12

Thread: How do I read shared memory data written by Qt using boost ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Qt products
    Qt4 Qt5
    Platforms
    Windows
    Thanks
    92
    Thanked 16 Times in 16 Posts

    Default Re: How do I read shared memory data written by Qt using boost ?

    Now in addition to that, I created a shared memory using Boost shared memory in Qt, wrote a string into that. Then tried to access the same using another Boost program compiled in Cygwin-g++. Here get_size() is giving 0 and string is not being read. But surprising thing is, if I delete the same shared memory (for the specified key) using remove statement in cygwin-g++ program, it's getting deleted.

    Qt Code:
    1. bool isRemoved = boost::interprocess::shared_memory_object::remove("ShrdMem");
    2. std::cout << "Value = " << isRemoved << std::endl; // Value = 1
    To copy to clipboard, switch view to plain text mode 

    Writing in Qt(using QSharedMemory), then reading using Boost shared memory - Not working as expected
    Writing in Qt(using boost shared memory), then reading using Boost shared memory - Not working as expected
    Writing in Boost, reading in Boost(both compiled & run in cygwin-g++) - Working fine (tested to read the string/int value).

    Any help pls. Thank you.
    Last edited by rawfool; 16th May 2013 at 09:08.

Similar Threads

  1. How to read value which written inside the QLineEdit
    By RENOLD in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2012, 14:59
  2. shared memory - the right way to do it
    By fearu in forum Newbie
    Replies: 0
    Last Post: 27th October 2011, 00:46
  3. Replies: 1
    Last Post: 18th October 2010, 17:07
  4. QPixmap: X11 "memory leak" due to shared pixmap data?
    By chezifresh in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2009, 20:53
  5. QT shared memory
    By sweetsubha2020 in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2009, 06:30

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.