I am using Modern C++ version of DDS 5.3.1
In my DataReaderListener''s on_data_available() callback function, the data samples is in the DDS Thread.
dds::sub::LoanedSamples<My_Cmd> samples = reader.read();
i want to do a PostMessage to the Main Thread. Is it ok to to do the following
My_Cmd MySample = samples[0];
PostMessage(_myHWND, WM_DATA, (WPARAM)(&MySample),0);
As far as i know its not recommended to use pointers in the Modern C++ API does it apply to Data samples?
Hi Calvin,
If you want to get the data in your main thread, have you considered using waitsets? In many cases, waitset is a better option than callbacks.
You can find a example here, and there are some snippets and info in the manuals.
Let me know if that's closer to what you need or if you still prefer the PostMessage option.
Thanks,
Sara