I am writing a service that has several modules, all derived from a base class. I have an application that uses remoting to communicate with the service and that all works great.
I want to add the ability to update config details from the windows app, but I would like to define the config form with the module it relates to. So grabbing the remote proxy and executing a method to display the form doesn't work, because the service is trying to open the form and it has no access to the UI. Is there some other way to do this? I tried cloning my proxy objects, but the clones become proxies too. I need to be able to create a new form and copy all the form details (controls, methods, etc) from the proxy form to the new form. Does anyone know how I can do this?
Thanks
ROSCO
Loading
Ross CrawfordPosted Jun 23, 2008, 7:55 PM
Form myForm = (Form)Activator.CreateInstance(remote.FormType);
myForm.Show();
Works a treat! Thanks again.
ROSCO
Bechir BejaouiPosted Jun 23, 2008, 9:17 AM
System.Runtime.Remoting.ObjectHandle myObject = Activator.CreateInstance("libraryname, libraryclass");
myObject.Unwrap();
type myType = myObject.GetType();
methodinfo m = myType.GetMethod("Show"); //to show the page
m.invoke();
hope that helps you