Hi,

I've some problems with message methods with string identifiers: the
DispatchStr method in the TObject class seems not to be working.
For example I have:

TMsg = record
 messageName:String[200];
 messageValue:integer;
end;

TTestMessages = class(TObject)
 ...
 procedure OnClick(var msg:TMsg); message 'OnClick';
 ...
end;

But when I do:

procedure TTestMessages.TestStr();
var
 msg:TMsg;
begin
 msg.messageName:='OnClick';
 ...
 DispatchStr(msg);
end;

The "OnClick" procedure it's not being called. With cardinal
identifiers it's all working. I've tried with FPC 2.2.0, 2.2.2 and
attached an example program.
Reading and trying the implementation of the DispatchStr method I've
found that the "name" field of the MsgStrTable seems not to be filled.
Probably I haven't understood the behaviour of something.
Where I'm wrong?
Thanks in advance,

Leonardo

Attachment: testmessaggi.pas
Description: Binary data

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to