What I need is to write a DLL that run as NT service (in VB of course), and have full feature of a service:
- Can be Start, Stop, Restart
- Support Start Parametter
I can' t find documentation for the problem.:confused:
Pls someone help..., thanks
Printable View
What I need is to write a DLL that run as NT service (in VB of course), and have full feature of a service:
- Can be Start, Stop, Restart
- Support Start Parametter
I can' t find documentation for the problem.:confused:
Pls someone help..., thanks
Hi,
There is a very usefull microsoft util that will do this (if you are NT or better) - svrany.exe (Im nt and so found it on the NTRK (Resource Kit). (ms's site might be worth a try)
Given a suitable DLL - This will load/run and it appear in the services area just like any other. If usefull I can post info when I get back to work (@home@ the moment)
isnt hard - cheers, A.J.P.
hi -
sorry I might have lead you astray - sryany deals with exe files and turns them into services (dunno about a dll as it runs under a parent process...)
info for an .exe
(eg - myapp was a vb exe without a form just run from a prompt)
myapp.exe /parm1=whatever /parm2=/somethingelse
- from the NTRK
- created a directory - appdir
- copied from the cd to my dir - instsrv.exe, srvany.exe and move my app here (myapp.exe)
- "instsrv myapp c:\appdir\srvany.exe" to create a service
- from the service pannel - myapp - startup and specified an id/password for the service to use (or local)
- regedt32 - localmachine - system - currentcontrolset - services - myappr - create subkey (parameters) and the following keys
- - applicition : reg_sz: c:\appdir\myapp.exe
- - appparameters : reg_sz : /parm1=whatever /parm2=/somethingelse
-net start myapp
- job done!! - bingo
Sorry about the question too :-)
All services that I've seen are .exe files.
So I think make a DLL run as service may not possible
In my case what I have to do is:
- Write a COM DLL with classes
- Write an exe file use the DLL
I also found documentation in MSDN keyword: services [win32]
Thanks anyway :-)