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. C#
  4. Multiple Windows Forms Programs Interacting?

Multiple Windows Forms Programs Interacting?

Scheduled Pinned Locked Moved C#
questionwinformshelp
2 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.
  • S Offline
    S Offline
    stephan smolek
    wrote on last edited by
    #1

    I am writing a program that consists of several applications, some are client applications, one is the master application, all are standard Windows Forms apps. The clients can all be started seperatly by the user, or the master application starts them automaticly to have the standard user interaction of the client programs and also automated interaction / control with the master program. I would like to do the interaction by simply using public methods and events. My question is now how do I start the client applications automaticly by the master to have this sort of access? Do I simply create a new instance of the clients main forms? Should I do this in seperate threads to avoid locking up the master program while the clients are working? Or do I have to somehow use Application.Run(), if so how do I do this? Are there any severe pitfalls I am missing? Help would be appreciated, Stephan

    D 1 Reply Last reply
    0
    • S stephan smolek

      I am writing a program that consists of several applications, some are client applications, one is the master application, all are standard Windows Forms apps. The clients can all be started seperatly by the user, or the master application starts them automaticly to have the standard user interaction of the client programs and also automated interaction / control with the master program. I would like to do the interaction by simply using public methods and events. My question is now how do I start the client applications automaticly by the master to have this sort of access? Do I simply create a new instance of the clients main forms? Should I do this in seperate threads to avoid locking up the master program while the clients are working? Or do I have to somehow use Application.Run(), if so how do I do this? Are there any severe pitfalls I am missing? Help would be appreciated, Stephan

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      stephan.smolek wrote:

      The clients can all be started seperatly by the user, or the master application starts them automaticly to have the standard user interaction of the client programs and also automated interaction / control with the master program.

      The only way to start the other applications is by using the Process class to launch them.

      stephan.smolek wrote:

      also automated interaction / control with the master program

      You cannot just expose public methods and expect to be able to call them acrossed AppDomain boundries. You're going to have to learn about .NET Remoting, or Windows Communication Foundation, and setup remoting servers and clients in your applications to handle the communication and you'll also have to carefully design your applications to expose their functionality through various object models, kind of like how Word and Excel do it.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      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