[fpc-devel] Message method with a string identifier

Michael Van Canneyt michael at freepascal.org
Tue Jul 14 15:17:20 CEST 2009



On Tue, 14 Jul 2009, Don Whitbeck wrote:

> //Defining msg
> Type
>   TMsg = record
>        MsgStr: string[20];   //Doesn't work
> 	                              //MSGID: integer;  // Works
> 	Data: pointer;
>    end;
>
> TCustomSocket = Class(TObject)
> ...
> Procedure MsgHandler(Var Msg: TMsg); Message 'OnAccept';
>
>
> ASocket:=TCustomSocket.Create;
> var
>   msg: TMsg;
> ....
>   msg.MsgStr := 'OnAccept';
>  msg.Data := PS;     // Pointer to data
>   ASocket.dispatchStr(msg);
>
>
> Defining a message handler identified with an integer and calling with dispatch
> works.
> For some reason I am not successful in defining a message handler identified
> with a string and calling it with dispatchstr.

There is a bug, obviously the string dispatch table is not written to the assembler
file.  I created a bugreport.

Michael.



More information about the fpc-devel mailing list