1

void SendDataFromWorkerThread(HWND handle)

{

 int *x = new int(10);

 ::PostMessage(handle, user_defined_message_id, 0, (LPARAM)x);

}

While receiving on different thread..

void GetDataFromWorkerThread(WPARAM wparam, LPARAM lparam)

{

int *x = (int*) lparam;

// But it does not give the right data.
// It gives 0 at that memory address.
//( Also memory Address pointed by lparam is different from what was sent)

}

My application is single thread where I am delegating some work( return some data, above x value "10" ) to the worker thread. I am getting the message properly but not the data.

coder
  • 65
  • 2
  • 8

0 Answers0