Starting Windows Form in new AppDomain
-
Hi all, I'm trying to create a second (or third, or however many needed) AppDomain in which to host some Windows Forms. I can create the second AppDomain and the form object just fine. The problem is with actually showing the form. Basically the form partially draws itself and then hangs. I suspect maybe this has something to do with the STAThreadAttribute. What do I need to do to allow the window to run correctly in the second AppDomain? Thanks, Brandon W.
-
Hi all, I'm trying to create a second (or third, or however many needed) AppDomain in which to host some Windows Forms. I can create the second AppDomain and the form object just fine. The problem is with actually showing the form. Basically the form partially draws itself and then hangs. I suspect maybe this has something to do with the STAThreadAttribute. What do I need to do to allow the window to run correctly in the second AppDomain? Thanks, Brandon W.
-
bwilhite wrote:
I can create the second AppDomain and the form object just fine.
You are creating the form how? http://blogs.msdn.com/suzcook/archive/2003/06/12/57169.aspx[^]
led mike
I'm using AppDomain.CreateInstance() Then I'm unwrapping the ObjectHandle, and calling Form.Show(). Pretty much every example I've been able to find hasn't dealt with creating UI objects in another AppDomain. I'm pretty sure this would work fine, if it was just a plain old object. BW (Looking at that link now...)
-
bwilhite wrote:
I can create the second AppDomain and the form object just fine.
You are creating the form how? http://blogs.msdn.com/suzcook/archive/2003/06/12/57169.aspx[^]
led mike