At this point I am no longer able to reproduce the error. The messages are all getting through, and the program does not crash. I am using the Dispatch method I described.
I added a DefaultHandler to each form that responded to a message and monitored the messages. Note the peculiar (w <= 32767) to screen system messages.
procedure TGraphForm.DefaultHandler(var msg);
begin
UnhandledMessageDlg('GraphForm', msg); // debug
end;
procedure UnhandledMessageDlg(form: string; var msg);
var
w: longword;
s: string;
begin
w := TVMessage(msg).Id;
if (w > LM_User) and (w <= 32767) then begin
s := 'Unknown';
case w of
OM_FileChange : s := 'FileChange';
OM_DataChange : s := 'DataChange';
...
end;
s := 'Unhandled Message in ' + form + ': ' + s + ' ($' + IntToHex(w, 4) + ')';
ShowMessage(s);
end;
end;
Then I commented out all the message directives, and turned them back on one by one. No error, and all is working, but I am not clear why.
So... I guess this is closed unless the behavior reappears.
I appreciate the input!
Cheers,
VTwin