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
Cloning a form?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Bechir BejaouiRank #144 · 15.9K reputationPosted Jun 23, 2008, 5:17 AM EDT
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
Ross Crawford3 reputationPosted Jun 23, 2008, 3:55 PM EDT
Form myForm = (Form)Activator.CreateInstance(remote.FormType);
myForm.Show();
Works a treat! Thanks again.
ROSCO