I have a problem using events occuring in a object in the Mainform.
I've created an array of objects with the name TUser.
Inside this object is an event with the name OnStreamReceivedFromClient which is of the type EventOnStreamReceived which is a procedure passing a TMemoryStream.
Now I've tried casting that event to an event in the MainForm doing the following:
private:
Users : Array of TUser;
implementation
SetLength(Users,Length(Users)+1);
Users[Length(Users)-1] := TUser.Create(Self,ListViewUsers, APort);
Users[Length(Users)-1].OnStreamReceivedFromClient := EventDirectStream;
The implementation part is called if a new user is created.
On the event occurence I get the error :
Access Violation at address 00404344 in module 'Chat.exe' . Read of
address 008D5B40.
Is there any way to pass an event occurence from inside an array of objects or do I have to start polling to see if the event occured?
I've created an array of objects with the name TUser.
Inside this object is an event with the name OnStreamReceivedFromClient which is of the type EventOnStreamReceived which is a procedure passing a TMemoryStream.
Now I've tried casting that event to an event in the MainForm doing the following:
private:
Users : Array of TUser;
implementation
SetLength(Users,Length(Users)+1);
Users[Length(Users)-1] := TUser.Create(Self,ListViewUsers, APort);
Users[Length(Users)-1].OnStreamReceivedFromClient := EventDirectStream;
The implementation part is called if a new user is created.
On the event occurence I get the error :
Access Violation at address 00404344 in module 'Chat.exe' . Read of
address 008D5B40.
Is there any way to pass an event occurence from inside an array of objects or do I have to start polling to see if the event occured?