#1 Re: mORMot 1 » TWebSocketProtocolRest » 2015-07-26 06:11:32

I am a long time RAD Delphi Programmer, so Programming in Mormot way is quite difficult for me. But i'm insist to try though.
And now I've been spending my whole night, trying to Clone the Client Server Chat sample (Project31-> implementation of TWebSocketServerRest) into Highlevel VCL environment. But i keep failing.
What i'm trying to do is to visualize all the activity (Incoming Join, Message, And Who is Leaving the room) in my server mainForm via a method pointer.
For example like below:
Type TOnReadEvent= Procedure(msg: string) of Object; 
procedure TServerMainForm.OnRead();
begin
  Memo1.lines.add(msg);
  ...
end;
Then i create a method pointer property in the service interface  and  also in the class implementation.
for later, i can bind it to My TServerMainForm.OnRead method. Then I produce all the message activity manually by calling those method pointer property inside Join and NotifyBlaBla of the server service class. But, The program produced Runtime Error 217, For it seems that Declaring a Method Pointer in interface is not allowed in Delphi. But i'm not sure about that.
So would you please help me, is there any beter way to do this, is there any published method or property maybe something like the one in TWebSocketProtocolChat example which is "OnIncomingFrame" property.
Thanks Sir ! Sorry For my bad english.

Board footer

Powered by FluxBB