Results 1 to 4 of 4

Thread: sharing Memory between process (visual c++ application and Qt application )

  1. #1

    Default 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

  2. #2
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: sharing Memory between process (visual c++ application and Qt application )


  3. #3

    Default Re: sharing Memory between process (visual c++ application and Qt application )

    Quote Originally Posted by zuck View Post
    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 :
    Qt Code:
    1. m_hSharedMemoryFile = CreateFileMapping((HANDLE)0xFFFFFFFF,
    2. NULL,
    3. PAGE_READWRITE,
    4. 0/*dwMaximumSizeHigh*/,
    5. dwNumberOfBytesToMap/*dwMaximumSizeLow*/,
    6. csName.GetBuffer(0));
    To copy to clipboard, switch view to plain text mode 

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. MDI application memory issue
    By sirQit in forum Qt Programming
    Replies: 7
    Last Post: 8th July 2009, 20:32
  2. Show dialog application lunched as a process.
    By mourad in forum Qt Programming
    Replies: 0
    Last Post: 13th October 2008, 14:27
  3. Replies: 3
    Last Post: 4th March 2008, 09:35
  4. I have memory leak on every Qt3/4 application, Qt bug?
    By saugumas in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2007, 20:33
  5. Module to process application parameters
    By Opilki_Inside in forum General Programming
    Replies: 4
    Last Post: 9th February 2007, 00:26

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.