d***@mac.com
2006-11-16 15:38:51 UTC
I have two applications that I want to talk to each othe
Application 1 uses the following code to send some information to
Application 2 and lock up until it gets an appropriate reply:
MF.Enabled := False; // Deactivate the main form
sent := SendMessage(rh, WM_COPYDATA, Integer(Handle),
Integer(@copyDataStruct));
if sent > 0 then // reactivate the main form when
edits are over
Application 2 catches the message using the following code:
procedure TEditProjectDetails.WMCopyData(var msg: TWMCopyData);
begin
HandleReceivedMessage(Msg.CopyDataStruct);
// Only want to return result if
Msg.Result := 1;
end;
The HandleReceivedMessage procedure uses the received information to
seed a form which is then edited and saved.
Whilst I can seed the form what I cannot figure out is how to wait
until the data is saved to send the Msg.Result back to Application 1.
Copying Msg into a global variable seems not to work when I assign to
Msg.Result at a later point...
Application 1 uses the following code to send some information to
Application 2 and lock up until it gets an appropriate reply:
MF.Enabled := False; // Deactivate the main form
sent := SendMessage(rh, WM_COPYDATA, Integer(Handle),
Integer(@copyDataStruct));
if sent > 0 then // reactivate the main form when
edits are over
Application 2 catches the message using the following code:
procedure TEditProjectDetails.WMCopyData(var msg: TWMCopyData);
begin
HandleReceivedMessage(Msg.CopyDataStruct);
// Only want to return result if
Msg.Result := 1;
end;
The HandleReceivedMessage procedure uses the received information to
seed a form which is then edited and saved.
Whilst I can seed the form what I cannot figure out is how to wait
until the data is saved to send the Msg.Result back to Application 1.
Copying Msg into a global variable seems not to work when I assign to
Msg.Result at a later point...