Omar Natour
Omar Natour

Reputation: 111

Changing the value that lParam points at

I'm using Visual C++ /MFC and I'm sending a message as SendMessage(GetParent(hDlg) ,MY_MESSAGE , 0 , LPARAM(x) );

How could I change the value of x inside the hDlg parent callback function ?

For example if I send the message SendMessage(hWnd , WM_GETTEXT ,0 , LPARAM(buffer); the buffer is returned full of the text . How did the buffer changed it's value ?

Upvotes: 0

Views: 502

Answers (1)

ScottMcP-MVP
ScottMcP-MVP

Reputation: 10415

(buffer) is a pointer to some memory that has already been allocated. The WM_GETTEXT operation can use that pointer to put data into the allocated memory. You can do the same thing if your (x) variable is a pointer to some memory that has already been allocated.

Upvotes: 1

Related Questions