如何实现在WINDOWS注销时,不退出我运行的程序?(没人知道?) (100分)

  • 主题发起人 主题发起人 yeath
  • 开始时间 开始时间
Y

yeath

Unregistered / Unconfirmed
GUEST, unregistred user!
如何实现在WINDOWS注销时,不退出我运行的程序(操作系统:WINDOWS XP)
 
作成服务
 
做成服务我知道可以,我不想写成服务。。。<br>写成服务后,我用ado去访问数据库,会出现 问题,不知道怎么回事。
 
据我所知只有写服务程序<br>你权衡跟数据访问问题相比那个更容易解决
 
&nbsp; &nbsp; &nbsp; &nbsp;int packageLen = Socket-&gt;ReceiveBuf((void *)&amp;mySms, sizeof(SSMSStruct));<br>&nbsp; &nbsp; &nbsp; &nbsp; if (packageLen == sizeof(SSMSStruct))<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!ADOConnection1-&gt;Connected)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADOConnection1-&gt;Open();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADOQuery1-&gt;SQL-&gt;Clear();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADOQuery1-&gt;SQL-&gt;Add("一个Insert语句");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ADOQuery1-&gt;ExecSQL();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch (Exception &amp;exception)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strcpy(retCode, "0099"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 通讯错<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; } else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strcpy(retCode, "0011"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 通讯错<br>我的服务是先接收客户端的数据,再写到数据库里,不是服务程序能正常写入,服务程序<br>就不行,我不知道怎么回事?<br>高手快帮小弟看看。。。晕了。。。<br>
 
难道服务程序里不能使用Ado这种控件???
 
小声问一句,你用的数据库是Oracle的吗?<br>如果是的话,恐怕就不是服务里不能用ADO,而是ADO访问Oracle还有这样那样的问题,平常应用中不出现,特殊一点的应用就出现了。
 
不是Oracle,我用的是sql server,已经解决了。换成BDE的控件就解决了。。。<br>发分
 
多人接受答案了。
 
后退
顶部