Hello! I will try to keep this as short and concise as possible.
I am working on a client-server application. Everything worked well, the client (which consisted of a form at that time) got the events from the server, but the problem was that I was doing everything in the form class. So I thought that it would be nicer
to create a 'Client' class which the form would use. All the code would go in the Client class and the form class would just call one or two methods.
Now, my Client class gets the events from the server, does something with the data, and fires its own events which should be picked up by the form class, but that doesn`t happen. I experimented a bit, trying to fire events from different classes, changed
some code here and there and came to the conclusion that if my Client class inherits from Control, the form class will pick up the events fired from the Client class.My questions is the following: what exactly should i add to my Client class (the necessary
minimum) in order for the events to work properly? Inheriting from Control just to make the events work seems a bit too much.
Edit: I tracked it down and the 'most base' class that I have to inherit from is MarshalByRefObj. Is this always necessary in cases such as mine? And if yes, why?
View Complete Post