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. Windows Service

Windows Service

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 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.
  • Z Offline
    Z Offline
    zhaopi
    wrote on last edited by
    #1

    I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!

    J G Z 3 Replies Last reply
    0
    • Z zhaopi

      I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      zhaopi wrote: When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. What does "failed to start" means exactly? zhaopi wrote: Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... It's hard to do that with the info you provide. Perhaps if you give more details about the error and post a code snippet showing what you are doing, someone may suggest something useful. -- jlr http://jlamas.blogspot.com/[^]

      G 1 Reply Last reply
      0
      • Z zhaopi

        I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!

        G Offline
        G Offline
        Garth J Lancaster
        wrote on last edited by
        #3

        Do you do any logging of the service startup and your own code ? If the service was working before you added your code, then obviously its something in the socket init sequence thats doing it - so you need to put logging steps around this area of your code - did you test the code that creates the socket instance OUTSIDE the service ?? its easier to test such things from a standalone exe first, THEN add them to a service (imho) Either way, you should be using the Application Event log (judiciously) and other logging methods when you're in the service. 'G'

        1 Reply Last reply
        0
        • J Jose Lamas Rios

          zhaopi wrote: When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. What does "failed to start" means exactly? zhaopi wrote: Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... It's hard to do that with the info you provide. Perhaps if you give more details about the error and post a code snippet showing what you are doing, someone may suggest something useful. -- jlr http://jlamas.blogspot.com/[^]

          G Offline
          G Offline
          Garth J Lancaster
          wrote on last edited by
          #4

          Heck - I like your answer better than mine (see below) - we must have been sending a response at roughly the same time .. 'G'

          J 1 Reply Last reply
          0
          • G Garth J Lancaster

            Heck - I like your answer better than mine (see below) - we must have been sending a response at roughly the same time .. 'G'

            J Offline
            J Offline
            Jose Lamas Rios
            wrote on last edited by
            #5

            Garth J Lancaster wrote: Heck - I like your answer better than mine (see below) I don't think mine is better. I think they complement each other. :) Cheers, -- jlr http://jlamas.blogspot.com/[^]

            1 Reply Last reply
            0
            • Z zhaopi

              I am currently integrating a correctly running windows service and a win32 application into a windows service which will listening to certain sockets with specified port. Individually, both of them works fine. When i replace the endlessloop of the windows service with a segment of code which creates a socket instance, the service failed to start. Can anybody explain to me the reason or suggest some rational modification that i should make to solve the problem... Thanks for any help in advance!

              Z Offline
              Z Offline
              zhaopi
              wrote on last edited by
              #6

              Thanks for all your help, i have checked my code and the problem has been solved.:-D

              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