how to register an app as a service 
Author Message
 how to register an app as a service

How is this done in Windows NT,

The code to do this for Windows 9x is

Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long
Declare Function GetCurrentProcess Lib "kernel32.dll" () As Long
Declare Function RegisterServiceProcess Lib "kernel32.dll" (ByVal
dwProcessID As Long, ByVal dwType As Long) As Long
Sub StartService()
    Dim pid As Long
    Dim regserv As Long
    pid = GetCurrentProcessId()
    regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub



Sun, 08 May 2005 02:10:23 GMT  
 how to register an app as a service
Hi, Kevin

If you are trying to register a service written in VB.Net, there are a
couple of ways to get there.  For starters, take a look at Knowledge Base
article Q317421 for an example of distributing a dotnet service.  Here is a
link:

HOW TO: Create a Setup Project for a Windows Service in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=kb;[LN];Q317421

If you are trying to start a service written in VB6 or earlier, Microsoft
does not currently recommend, and does not support, running Visual Basic
applications as Microsoft Windows NT Services because the applications may
exhibit unstable behavior when installed and run as Microsoft Windows NT
Services. Microsoft Visual Basic 4.0 does not support callbacks nor is
Visual Basic 4.0 thread-safe. While Visual Basic 5.0 and 6.0 is
apartment-model thread-safe, there is no way to marshal calls back into a
Visual Basic program through the AddressOf operator. This behavior is by
design

If you just want to use a VB application to register a service, you would
be better off posting your question in the
microsoft.public.win32.programmer.kernel newsgroup.

HTH,

John Eikanger
Microsoft Visual Basic Team

This posting is provided AS IS with no warranties, and confers no rights.
(c) 2002 Microsoft Corporation.  All rights reserved.
--------------------

| Subject: how to register an app as a service
| Date: Tue, 19 Nov 2002 13:10:23 -0500
| Lines: 18
| X-Tomcat-NG: microsoft.public.vb.syntax
|
| How is this done in Windows NT,
|
| The code to do this for Windows 9x is
|
| Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long
| Declare Function GetCurrentProcess Lib "kernel32.dll" () As Long
| Declare Function RegisterServiceProcess Lib "kernel32.dll" (ByVal
| dwProcessID As Long, ByVal dwType As Long) As Long
| Sub StartService()
|     Dim pid As Long
|     Dim regserv As Long
|     pid = GetCurrentProcessId()
|     regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
| End Sub
|
|
|
|
|



Sun, 08 May 2005 04:17:42 GMT  
 how to register an app as a service
Hi,
I used the NTSVC.OCX control for running my apps as NT services. I tested on
W2K also, everything working fine. NTSVC.OCX is freely available from MS. A
Google search will surely do...

Wolfgang



Quote:
> Hi, Kevin

> If you are trying to register a service written in VB.Net, there are a
> couple of ways to get there.  For starters, take a look at Knowledge Base
> article Q317421 for an example of distributing a dotnet service.  Here is
a
> link:

> HOW TO: Create a Setup Project for a Windows Service in Visual Basic .NET
> http://support.microsoft.com/default.aspx?scid=kb;[LN];Q317421

> If you are trying to start a service written in VB6 or earlier, Microsoft
> does not currently recommend, and does not support, running Visual Basic
> applications as Microsoft Windows NT Services because the applications may
> exhibit unstable behavior when installed and run as Microsoft Windows NT
> Services. Microsoft Visual Basic 4.0 does not support callbacks nor is
> Visual Basic 4.0 thread-safe. While Visual Basic 5.0 and 6.0 is
> apartment-model thread-safe, there is no way to marshal calls back into a
> Visual Basic program through the AddressOf operator. This behavior is by
> design

> If you just want to use a VB application to register a service, you would
> be better off posting your question in the
> microsoft.public.win32.programmer.kernel newsgroup.

> HTH,

> John Eikanger
> Microsoft Visual Basic Team

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> (c) 2002 Microsoft Corporation.  All rights reserved.
> --------------------

> | Subject: how to register an app as a service
> | Date: Tue, 19 Nov 2002 13:10:23 -0500
> | Lines: 18
> | X-Tomcat-NG: microsoft.public.vb.syntax
> |
> | How is this done in Windows NT,
> |
> | The code to do this for Windows 9x is
> |
> | Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long
> | Declare Function GetCurrentProcess Lib "kernel32.dll" () As Long
> | Declare Function RegisterServiceProcess Lib "kernel32.dll" (ByVal
> | dwProcessID As Long, ByVal dwType As Long) As Long
> | Sub StartService()
> |     Dim pid As Long
> |     Dim regserv As Long
> |     pid = GetCurrentProcessId()
> |     regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
> | End Sub
> |
> |
> |
> |
> |



Sun, 08 May 2005 08:06:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Register and running VB5 formless app as a service in NT 4.0 Server

2. Registering app as service process under NT4?

3. VB.NET DLL can register with regsvr32 but cannot register with Component service

4. VB.NET DLL can register with regsvr32 but cannot register with Component service

5. Warning message when creating Excel object from Vb App when app is running as a service

6. Register TLB in Component Services

7. CLR Debugging Services - Registered JIT Debugger is not Available

8. registering com+ service in VB

9. what registry entries do I need to register a file as service

10. Cash Register (Samsung) Programmer Consultant Service Offered

11. Register IAS Service in Active Directory with script

12. Registering services in NT 4.0 (SP 6.5a)

 

 
Powered by phpBB® Forum Software