Return data when using SendMessage
-
Hi there. I am currently using a worker thread that communicates to the main thread using a call to sendmessage everything works great but now i need to return a string from that sendmessage handler to my worker thread. How can i return data from there, is it possible? Thanks
-
Hi there. I am currently using a worker thread that communicates to the main thread using a call to sendmessage everything works great but now i need to return a string from that sendmessage handler to my worker thread. How can i return data from there, is it possible? Thanks
Send a pointer to a buffer in the
lParam
parameter, so the called function can store data in it. However make sure the buffer is big enough to receive the response. Alternatively you could use a shared buffer and protect it with locks.I must get a clever new signature for 2011.
-
Send a pointer to a buffer in the
lParam
parameter, so the called function can store data in it. However make sure the buffer is big enough to receive the response. Alternatively you could use a shared buffer and protect it with locks.I must get a clever new signature for 2011.
-
Yeah the first solution you tell about was the one i was using but i though it was ugly and not a good practice but it worked, i passed a CString pointer, but the 2nd solution you post how could it be implemented? Thanks