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 / C++ / MFC
  4. Difference between Service and Console Application

Difference between Service and Console Application

Scheduled Pinned Locked Moved C / C++ / MFC
databasequestion
6 Posts 5 Posters 1 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.
  • K Offline
    K Offline
    Kotesh N
    wrote on last edited by
    #1

    Hai, I have a small query regrading the application ie what is the difference between Service and Console Application. Regards, Chinna

    J C 2 Replies Last reply
    0
    • K Kotesh N

      Hai, I have a small query regrading the application ie what is the difference between Service and Console Application. Regards, Chinna

      J Offline
      J Offline
      Jonathan Darka
      wrote on last edited by
      #2

      Not as much as you would think. Think of it this way, a Service is a Console application except that it has different security settings and is started by the Operating System rather than a user (normally anyway). A Service should have NO user interface at all, where as a Console application could output text for the user to read. The SCM (Service Control Manager) basically tells a Service when to START, STOP, PAUSE or CONTINUE, etc.


      Jonathan Wilkes Darka [Xanya.net]

      T 1 Reply Last reply
      0
      • J Jonathan Darka

        Not as much as you would think. Think of it this way, a Service is a Console application except that it has different security settings and is started by the Operating System rather than a user (normally anyway). A Service should have NO user interface at all, where as a Console application could output text for the user to read. The SCM (Service Control Manager) basically tells a Service when to START, STOP, PAUSE or CONTINUE, etc.


        Jonathan Wilkes Darka [Xanya.net]

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Jonathan [Darka] wrote:

        hink of it this way, a Service is a Console application except that it has different security settings and is started by the Operating System rather than a user (normally anyway).

        sorry for correcting you sir.. you can make gui based service too

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

        J D 2 Replies Last reply
        0
        • T ThatsAlok

          Jonathan [Darka] wrote:

          hink of it this way, a Service is a Console application except that it has different security settings and is started by the Operating System rather than a user (normally anyway).

          sorry for correcting you sir.. you can make gui based service too

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

          J Offline
          J Offline
          Jonathan Darka
          wrote on last edited by
          #4

          ThatsAlok wrote:

          sorry for correcting you sir.. you can make gui based service too

          Sorry to correct you :-) I said "A Service should have NO user interface at all", i.e SHOULD have no user interface.


          Jonathan Wilkes Darka [Xanya.net]

          1 Reply Last reply
          0
          • T ThatsAlok

            Jonathan [Darka] wrote:

            hink of it this way, a Service is a Console application except that it has different security settings and is started by the Operating System rather than a user (normally anyway).

            sorry for correcting you sir.. you can make gui based service too

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Services themselves typically do not have a UI. Perhaps you are thinking of the SCM or a SCP.


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            1 Reply Last reply
            0
            • K Kotesh N

              Hai, I have a small query regrading the application ie what is the difference between Service and Console Application. Regards, Chinna

              C Offline
              C Offline
              Cristian Amarie
              wrote on last edited by
              #6

              A service is *most of the time* a console application. But not mandatory. This does not mean necessary that the service displays an user interface, but if the project was compiled with /subsystem:console or /subsystem:windows. Other than this, a service application is registered in system as such, accepts certain control codes, and is managed by SCM (Service Control Manager). One can write a service that can interact with the desktop and even display an user interface (although not recommended, sure), not only because a service *must* be a console application, but because this kind of application is intended to be not interactive, system managed, and perform a continuous "service" - hence the name - without user interface. However, a service can create hidden windows for special purpose messages, or use functions that require a message loop. Even COM uses special purpose windows from what I know, so indirectly creating, say, CoCreateInstance, in a service does not makes a service "window free". A console application is what its name says, just an application compiled for and executed in a console window. Nothing more.

              Nuclear launch detected

              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