📄 3934.html
字号:
<html>
<head>
<title>Re: Service 不可以有使用者介面</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Re: Service 不可以有使用者介面</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:wangkai@nease.net">kiingkong</a> on July 16, 1998 at 11:20:04:<p>
In Reply to: <a href="3922.html">Service 不可以有使用者介面</a> posted by 小吴 on July 16, 1998 at 07:32:20:<p>
<html><p><head><br></head><p><body bgcolor="#FFFFFF"><p><p><font size="2">我照您说的方法去做了,还是不行,具体步骤是:</font></p><p><p><font size="2">'frmserver的ShowOnTaskBar为false</font></p><p><p><font size="2">sub form_load()</font></p><p><p><font size="2">With frmserver </font></p><p><blockquote><br> <p><font size="2">If Command = "-install" Then </font></p><br> <blockquote><br> <p><font size="2">.NTService1.StartMode<br> =svcStartAutomatic </font></p><br> <p><font size="2">.NTService1.Interactive = True </font></p><br> <p><font size="2">.NTService1.Install </font></p><br> </blockquote><br> <p><font size="2">End If </font></p><br> <p><font size="2">If Command = "-uninstall" Then </font></p><br> <blockquote><br> <p><font size="2">.NTService1.Uninstall </font></p><br> <p><font size="2">Unload frmserver </font></p><br> </blockquote><br> <blockquote><br> <p><font size="2">End </font></p><br> </blockquote><br> <p><font size="2">End If </font></p><br> <p><font size="2">.NTService1.ControlsAccepted<br> =svcCtrlPauseContinue</font></p><br> <p><font size="2">.NTService1.StartService </font></p><br></blockquote><p><p><font size="2">End With</font></p><p><p><font size="2">End Sub</font></p><p><p><font size="2">然后,在NT上执行程式 server.exe<br>-install ,这时通过"Control Panel/Service"可以看到我的程式已经install成为一个service,但还没有start,于是我选start按钮,这时系统报错:"Address<br>is in use". 看起来象是winsock编程上面的错,但如果不是作为service运行则一切正常,说明程序是没有问题的。</font></p><p><p><font size="2">另外,我想问:NTService1.StartService这个语句,应该就是start这个service的意思吧,为什么每次install我的service之后,总要在"Control<br>panel/service"里面通过手动来start它?</font></p><p><p><font size="2">我最后的解决方法是放弃了这个OCX,我down了一个小程式,可以把任何程式设置成NT<br>service, 这个方法最初也不行,但后来用您介绍的方法:ShowOnTaskBar为false,终于成功了.</font></p><p><p><font size="2">我还是希望我可以直接使用哪个OCX,而不用什么外部程式,是不是我做的步骤不对?<br>我的程式是有界面的,但那只是为了debug,去掉它毫无影响.</font></p><p><p><font size="2">敬请指正!! </font></p><p><p><font size="2">kingkong</font></p><p><p><font size="2">wangkai@nease.net</font></p><br></body><br></html><br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 3934-->
<!--top: 3981--><li><a href="3981.html">程式写错了啦!</a> <b>小吴</b> <i>07:54:04 7/17/98</i>
(<!--responses: 3981-->0)
<ul><!--insert: 3981-->
</ul><!--end: 3981-->
</ul><!--end: 3934-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -