Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Starting Windows Form in new AppDomain

Starting Windows Form in new AppDomain

Scheduled Pinned Locked Moved .NET (Core and Framework)
winformshelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bwilhite
    wrote on last edited by
    #1

    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.

    L 1 Reply Last reply
    0
    • B bwilhite

      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.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      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

      B 2 Replies Last reply
      0
      • L led mike

        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

        B Offline
        B Offline
        bwilhite
        wrote on last edited by
        #3

        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...)

        1 Reply Last reply
        0
        • L led mike

          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

          B Offline
          B Offline
          bwilhite
          wrote on last edited by
          #4

          I might be able to use ExecuteAssembly, but it's going to take a bit more work than I want. I'll try it out. BW

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups