[omniORB] omniNames.exe and the -start parameter. omniNames
as an NT service.
david.sansom@db.com
david.sansom@db.com
Thu, 23 Sep 1999 08:49:46 +0000
--0__=Yp5sOICSUS1f5boT1KAhqpLrf8nJ7qwbOCJJq3Azl30vbttF79PLtaAb
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline
This is a link to the MS site for a sample service app.
http://msdn.microsoft.com/library/devprods/vs6/visualc/vcsample/vcsmpservicesamp
le.htm
There's also some example code available in the MSVC (v5 - I presume its in v6
too) on-line help:
mk:@ivt:pdwbase/native/sdk/win32/sys/src/services_8.htm
Check out the stuff on the Service Control Manager (SCM) for how to install a
service through code. There used to be a sample which implemented the service
code as a C++ class, but I've mislaid it - If I come across it I'll pass it on.
(The only downside of a class implementation is that the ServiceMain function
has to be a static function in your class, which then involves a lot of passing
around of 'this' pointers.)
DS.
---------------------- Forwarded by David Sansom/DMGGM/DMG UK/DeuBa on 23/09/99
08:40 ---------------------------
(Embedded
image moved dcmay@object-workshops.com
to file: 22/09/99 19:26
pic08818.pcx)
To: Norman_Smith@bmc.com; johnk@harlequin.co.uk
cc: omniorb-list@uk.research.att.com
Subject: RE: [omniORB] omniNames.exe and the -start parameter. omniNames as an
NT service.
> Actually, I was thinking more about your code, and had the
> thought that I
> have never investigated how to write an application as an
> actual NT service.
> I'd kind of like to take a look at your source as well.
Here is the source code for our NT service. What's missing is code to shut down
the service when it stopped, as well as to register the server with NT.
We use INSTSRV.EXE, which is available in the NT Resource Kit (the 3.5 ResKit is
- or was recently - still available on Microsoft's FTP site. Some of the apps
don't run under 4.0, but many still do). But it would be a lot cleaner if the
app could register itself as a service. Maybe someone else can contribute that
code?
Regards,
Dietmar
--0__=Yp5sOICSUS1f5boT1KAhqpLrf8nJ7qwbOCJJq3Azl30vbttF79PLtaAb
Content-type: application/octet-stream;
name="SRVNAMES.CPP"
Content-Disposition: attachment; filename="SRVNAMES.CPP"
Content-transfer-encoding: base64
Ly9saW5rIHdpdGggQURWTElCMzIuTElCDQoNCi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1biA/IFNFUlZJQ0VfUlVOTklORyA6IFNFUlZJQ0VfU1RPUFBF
RDsNCiAgICBzdGF0LmR3Q29udHJvbHNBY2NlcHRlZCA9IDA7DQogICAgc3RhdC5kd1dpbjMyRXhp
dENvZGUgPSAwOw0KICAgIHN0YXQuZHdTZXJ2aWNlU3BlY2lmaWNFeGl0Q29kZSA9IDA7DQogICAg
c3RhdC5kd0NoZWNrUG9pbnQgPSAwOw0KICAgIHN0YXQuZHdXYWl0SGludCA9IDA7DQogICAgU2V0
U2VydmljZVN0YXR1cyhoX1NlcnZpY2UsICZzdGF0KTsNCn0NChoNCg==
--0__=Yp5sOICSUS1f5boT1KAhqpLrf8nJ7qwbOCJJq3Azl30vbttF79PLtaAb
Content-type: application/octet-stream;
name="pic08818.pcx"
Content-Disposition: attachment; filename="pic08818.pcx"
Content-transfer-encoding: base64
CgUBCAAAAABoACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAABaQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAD1E9sTzRPHE8MTwhP1E9sTzRPHE8MTwhP1E9sTzRPHE8MTwhP1E9sTzRPH
E8MTwhP1E9sTzRPHE8MTwhP1E9sTzRPHE8MTwhP1E9sTzRPHE8MTwhP1E9sTzRPHE8MTwhP1E9sT
zRPHE8MTwhPwEwzIBgzYE8wTxhPDE8IT7hPOBtcTzBPGE8MTE+wTwgbCBwbCEgbCEgbCEsUG1hPL
E8YTwxMT6hMMwgYHwgLCAwISwgfEEsMCwwbVE8sTxRPDExPpE8MGAwcCBwMCwhLDB8ISwgISwgLD
BtUTyhPFE8MTE+gTwgIHA8ICEw4DDgLDE8USwwLCEMIG1BPKE8UTwxMT5xMCAwcDAg4TDgITwgIS
D8ISD8ISBRICEcICwwbUE8oTxRPCExPmEwYCBwMCDgIOwgLDExITEhPC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NzApsrw//vw
oKCkgICA/wAAAP8A//8AAAD//wD/AP//////AAAAgAAAAIAAgIAAAACAgACAAICAwMDAwNzApsrw
//vwoKCkgICA/wAAAP8A//8AAAD//wD/AP//////AAAAgAAAAIAAgIAAAACAgACAAICAwMDAwNzA
psrw//vwoKCkgICA/wAAAP8A//8AAAD//wD/AP//////AAAAgAAAAIAAgIAAAACAgACAAICAwMDA
wNzApsrw//vwoKCkgICA/wAAAP8A//8AAAD//wD/AP//////AAAAgAAAAIAAgIAAAACAgACAAICA
wMDAwNzApsrw//vwoKCkgICA/wAAAP8A//8AAAD//wD/AP//////AAAAgAAAAIAAgIAAAACAgACA
AICAwMDAwNzApsrw//vwoKCkgICA/wAAAP8A//8AAAD//wD/AP//////AAAAgAAAAIAAgIAAAACA
gACA//vwoKCkgICA/wAAAP8A//8AAAD//wD/AP//////
--0__=Yp5sOICSUS1f5boT1KAhqpLrf8nJ7qwbOCJJq3Azl30vbttF79PLtaAb--