By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

Create a Service from VB.NET

P: n/a
Anybody have sample code to create a service from VB.NET?

I have gotten this far:
declare function OpenSCManager & CreateService in "advapi32.dll"
Ohandle = OpenSCManager(...
SHandle = CreateService(...
error = GetLasError( )

I am getting an "ERROR 126 The specified module could not be found."

I' not sure what "specified module" this error is pointing to???

Help????
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Your GetLastError is wrong

Imports System.Runtime.InteropServices

Marshal.GetLastError

Here's some service articles for you:

http://support.microsoft.com/default...b;en-us;821794

http://support.microsoft.com/default...b;en-us;301273

http://support.microsoft.com/default...b;en-us;317421

http://abstractvb.com/code.asp?A=1082

http://www.devarticles.com/c/a/VB.Ne...ice-in-VB.NET/

The above are a few . Just search Google to find thousands more

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
"Bob Alvarado-QC-AZ" <Bo*************@discussions.microsoft.com> wrote in
message news:EE**********************************@microsof t.com...
Anybody have sample code to create a service from VB.NET?

I have gotten this far:
declare function OpenSCManager & CreateService in "advapi32.dll"
Ohandle = OpenSCManager(...
SHandle = CreateService(...
error = GetLasError( )

I am getting an "ERROR 126 The specified module could not be found."

I' not sure what "specified module" this error is pointing to???

Help????

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.