Well, I am trying to make remote UI server on a Form.
The remote service is defined in another class, which access the form in its implement.
When remote client calls, that service can no longer access the form.
It works fine if the form implements the service by itself. But we want to seperate concern between desktop application from remote access.
class MyForm : System.Windows.Forms {
....
public MyForm() {
....
// open TCP port, host my MyService
}
}
public interface IMyService {
public void ServiceMethod();
}
class MyService : MarshalByRefObject, IMyService {
public MyService(MyForm form) { ... }
public void ServiceMethod() { //use the form here }
}
Thing works just fine when the form implements the service by itself. But this is not what we want.
class MyForm : System.Windows.Forms, IMyService {
....
public MyForm() {
....
// open TCP port, host myself as IMyService
}
public void ServiceMethod() { // access UI on the form }
}
Thank you.
sovann