The member
cds.lpData
should be a pointer,
(LPARAM)&ResultWnd
(please fix the typo in the world "Result"), not
HWND
.
I would like to note, that exchanging data between two different processes is the artifact of the legacy Windows API created even before NT technology and is not a mainstream OS feature. The processes in real multi-process systems are supposed to be isolated and communicating only via IPC, such as sockets. So,
WM_COPYDATA
is neither safe not robust. You need to make a careful decision about it and consider alternative. The apparent simplicity of the approach could be very deceiving.
See also:
http://www.flounder.com/wm_copydata.htm[
^],
Interprocess Communication Between .NET and MFC Using WM_COPYDATA[
^].
—SA