Neither, copy the string.
Windows only guarantees the existance of the backing memory until SendMessage/DispatchMessage returns.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Im working in Win32 desktop application in cpp.
When a Window Proc is triggered with some WM_* msg, We may receive some LPARAM and WPARAM data. These parameters are different concerning the MSG passed. This can hold variable-length data like pointers to strings, structs, or class objects.
Suppose I want to do some ASYNC operation on some WM_* while passing the LPARAM, and WPARAM to it and let the OS continue its work. Should I pass the LPARAM, and WPARAM to the ASYNC operation by value or by reference? Which is the best practice?
Neither, copy the string.
Windows only guarantees the existance of the backing memory until SendMessage/DispatchMessage returns.