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