衡玉's Blog

Happy coding

windows服务ATL模板 服务启动后再停止出错,并且无法删除

衡玉 posted @ 2010年2月21日 17:48 in windows 服务编程 , 3858 阅读

 服务启动后再停止时出错,是因为我在成员函数PreMessageLoop()函数中缺少控制代码所致,控制代码如下:

 

HRESULT CRestoreSerModule::PreMessageLoop(int nShowCmd)
{
	m_status.dwControlsAccepted = m_status.dwControlsAccepted | SERVICE_ACCEPT_PAUSE_CONTINUE;
	HRESULT hr = __super::PreMessageLoop(nShowCmd);
	if (hr == S_FALSE)
		hr = S_OK;
	return hr;
}

 

加上这些代码即可正常启动、停止了。

至于无法删除,

[SC] deleteservice FAILD 1072    这个错误是因为停止没有相应,所以控制器上好像停止了,可是程序依然在运行,打开任务管理器,结束这个进程,在删除就没有问题了。

Avatar_small
Bihar Board Model Pa 说:
2022年9月14日 15:30

Bihar Board Model Paper 2023 Class 7 Pdf Download for SCERT & NCERT Hindi Medium, English Medium & Urdu Medium Students of Bihar School Examination, Patna Board, e-Shikshana, Nishtha Online and Bihar Board Online Portal at Bihar Board Model Paper Class 7 Bihar School Examination, Patna Board and various private school teaching staff of the state have designed and suggested the School Examination Board 7th Class study & learning material as Bihar Board 7th Class Model Paper 2023 with Mock Test and Practice Questions for Term1 & Term 2 Exams of the Course through BSEB STD-7 Model Set 2023.

Avatar_small
jio switch for pc do 说:
2022年12月17日 22:46

Jio Switch is created. A simple interface and the absence of advertisements are two positive aspects of the Jio application for India. However, the product does not include a cloud-based or on-premises alternative. jio switch for pc download JioSwitch, however, allows users to transfer or request large files with others and is quite simple to install and administer.

Avatar_small
SBI Payment Billdesk 说:
2023年1月26日 23:08

Paying the credit card dues on time, does ensure you have a good financial transaction and without letting you pay an excess late fee, and SBI Credit Card has a particular due date and paying the due amount by then will also have your credit score undisturbed. SBI Payment Billdesk Having debt is always a high risk and it is always better to pay the dues on time, else your debt will increase and will directly disturb your financial transaction.

Avatar_small
1st PUC Blueprint 20 说:
2023年2月13日 16:18

Karnataka 1st Year PUC 11th Class Model Paper 2024 Name of Board Board of Higher Secondary Education, Karnataka State or KSEEB Name of Exam Karnataka PUC 11th Or 12th Twelfth Examinations 2024 Exam Dates 1st March 2024 Supply Exam Dates in the Month Of May and June 2024. 1st PUC Blueprint 2024 Announcement Declaration Date of PUC 11th and 12th Class Result May 2nd Week 2024 So Download Available Karnataka PUC 11th Public Exam.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter