You can also use the name pipe like squidge said, it's a easy solution too and I recommend using it, but I don't know how, I never used it ^^.
-
About the name of the memory, it's in the tutorial, in the constructor:
Qt Code:
To copy to clipboard, switch view to plain text mode
And from the tutorial:
"Note that "QSharedMemoryExample" is passed to the QSharedMemory() constructor to be used as the key. This will be used by the system as the identifier of the underlying shared memory segment."
The "QSharedMemoryExample" is the name that they are using as the name.
Use the same name that you're using in your win32 app.
And you question about the signal the changes you can use the CreateEvent function.
http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx
edit:
How to do:
- CreateEvent in the launcher; CreateEvent Function
- Create a thread to wait the event using WaitForSingleObject; WaitForSingleObject Function
- In the Qt Process use OpenEvent to get the handle of the event; OpenEvent Function
- Write data to the SharedMemory.
- Use SetEvent in the handle, so the WaitForSingleObject will return now; SetEvent Function
* If you're using a "single-shot" read, in the launcher call CloseHandle in the event.
* If you want a two-way communication you can set two events and use Wait to monitor the changes, and using Set and Reset Event (ResetEvent Function) to notify that some work was done or need to wait before reading/writing.
Bookmarks