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. Visual Basic
  4. Creating A Windows Service...HELP!

Creating A Windows Service...HELP!

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialquestion
4 Posts 3 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.
  • G Offline
    G Offline
    GrindAZ
    wrote on last edited by
    #1

    I have a .NET DLL that contains two forms. This DLL works great from windows applications. But when I make a windows service that references the DLL the forms do not show, the form code executes without any errors but no forms are displayed. Does anyone know how to get this to work?

    J D 2 Replies Last reply
    0
    • G GrindAZ

      I have a .NET DLL that contains two forms. This DLL works great from windows applications. But when I make a windows service that references the DLL the forms do not show, the form code executes without any errors but no forms are displayed. Does anyone know how to get this to work?

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      I could be mistaken on this, but normally a service does not have any user interface, and the service framework may, in fact, prohibit any UI from displaying properly... though I would expect it throw an error in that case. If you want to run the code as a service, separate the UI and the logic into separate assemblies, then use the UI as an observer of the state of the service?

      1 Reply Last reply
      0
      • G GrindAZ

        I have a .NET DLL that contains two forms. This DLL works great from windows applications. But when I make a windows service that references the DLL the forms do not show, the form code executes without any errors but no forms are displayed. Does anyone know how to get this to work?

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

        OK. In general: Windows Services run in their own Windows sessions. What does this mean? Well, when you login to Windows, you start your own session. Services do the same thing. They get their own Window Station, Desktop, Environment, and such. This means that the user interface your app is putting is showing up, but it's on a desktop that you can't see. There is no way to view the session of a service! Services cannot interact with the user session directly (or easily.) But, it IS possible to write a service that interacts with the users desktop. Your going to have to supply the service with the logged on users security context, station handle, and desktop handle, at a minimum. Hint: Your going to have to write a seperate app that runs on the user side and communicates with the service via RPC to do this. Information on how this works (and why) can be found in the Platform SDK documentation. Just search for "Window Stations" (no S on the end of Window) on MSDN for a good starting point. RageInTheMachine9532

        G 1 Reply Last reply
        0
        • D Dave Kreskowiak

          OK. In general: Windows Services run in their own Windows sessions. What does this mean? Well, when you login to Windows, you start your own session. Services do the same thing. They get their own Window Station, Desktop, Environment, and such. This means that the user interface your app is putting is showing up, but it's on a desktop that you can't see. There is no way to view the session of a service! Services cannot interact with the user session directly (or easily.) But, it IS possible to write a service that interacts with the users desktop. Your going to have to supply the service with the logged on users security context, station handle, and desktop handle, at a minimum. Hint: Your going to have to write a seperate app that runs on the user side and communicates with the service via RPC to do this. Information on how this works (and why) can be found in the Platform SDK documentation. Just search for "Window Stations" (no S on the end of Window) on MSDN for a good starting point. RageInTheMachine9532

          G Offline
          G Offline
          GrindAZ
          wrote on last edited by
          #4

          Thanks for the info. I am going to check out Remoting via RPC and see how this works.

          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