I have two applications that use one common DLL. From application "A' I have sent a message with string parameter as shown below
txt := 'Test String'
SendMessage(Handle, MyMessage, 0, lParam(PChar(txt)));
and in the same DLL I have another function to read that message, But I have received an empty message. I don't know where I am doing mistake.
procedure MyClass.WndMethod(var Msg: TMessage);
var
Str: string;
begin
case Msg.Msg of
MyMessage:
begin
Str := string(PChar(Msg.LParam));
ShowMessage(Str); // Empty message
end;
end;
WM_COPYDATA
as described here stackoverflow.com/questions/10126342/…? – SevenEleven