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. How to create Multiple instance of Simple Windows Services? [modified]

How to create Multiple instance of Simple Windows Services? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • G Offline
    G Offline
    Game point
    wrote on last edited by
    #1

    Hi All I need to create Multiple instance of Windows Service ,how its possible? Thanks Raju

    :~ Failure is Success If we learn from it!!:~

    modified on Monday, July 26, 2010 7:30 AM

    N 1 Reply Last reply
    0
    • G Game point

      Hi All I need to create Multiple instance of Windows Service ,how its possible? Thanks Raju

      :~ Failure is Success If we learn from it!!:~

      modified on Monday, July 26, 2010 7:30 AM

      N Offline
      N Offline
      norish
      wrote on last edited by
      #2

      You can make the manager service which spawn multiple instance of some program. If you mean multiple processes by multiple, the manger service is like below;

      // define some structure for managing status.
      struct MyProcInfo {
      BOOL m_spawnSucceeded;
      PROCESS_INFORMATION m_processInfo;
      } m_myProcInfo[N];

      ...
      // execute and hold handles
      for (int j = 0; j < N; j++) {
      m_myProcInfo[j].m_spawnSucceeded = CreateProcess(SOME_PROGRAM, argsForIt, ...., &m_myProcInfo[j].m_processInfo);
      }

      Or if you do not mean multiple processes but multiple COM instances, you can easily write like that service with ATL COM AppWizard wizard in visual studio.

      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