Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Перезапуск сервиса [D6, NT4, Win2k, WinXP]


Ученик ©   (2002-07-24 10:42:00) 

Может ли сервис перезапустить самого себя, если может, то каким образом ?


IlyaA   (2002-07-25 14:26:00) [1]

Вот ещё немного. Почитай.


Platform SDK: Server Data Objects
ISdoServiceControl
[This is preliminary documentation and subject to change.]

[This technology will work only on Windows 2000 and Whistler. Future versions of Windows will support an alternate API.]

Use the ISdoServiceControl interface to control the service being administered on the SDO computer.

Methods and Properties in Vtable Order
IUnknown Methods

IDispatch Methods

ISdoServiceControl Methods Description
StartService Starts the service.
StopService Stops the service.
GetServiceStatus Retrieves the current status of the service.
ResetService Resets the service.


Remarks
Use the ISdoMachine::GetServiceSDO method to retrieve a pointer to an ISdoServiceControl interface.

Requirements
Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: SdoIas.idl.
Library: Included as a resource in IasSdo.dll.

See Also
Server Data Objects Reference, Server Data Objects Interfaces

Platform SDK Release: February 2001 Contact Platform SDK Order a Platform SDK CD Online



Requirements
Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: SdoIas.idl.
Library: Included as a resource in IasSdo.dll.
See Also
Server Data Objects Reference, Server Data Objects Interfaces


IlyaA   (2002-07-25 14:24:00) [2]

Почитай. Может поможет. Из MSDN


Platform SDK: Server Data Objects
ISdoServiceControl::ResetService
[This is preliminary documentation and subject to change.]

[This technology will work only on Windows 2000 and Whistler. Future versions of Windows will support an alternate API.]

The ISdoServiceControl::ResetService method resets the service that is administered by the SDO API. Resetting the service causes the service to refresh its data.

HRESULT ResetService (void);
Parameters
None.

Return Values
If the method succeeds the return value is S_OK.

If the method fails, the return value is one of the following error codes.

Value Meaning
E_ABORT The operation was aborted.
E_FAIL An unspecified error occurred.
E_INVALIDARG One of the parameters is invalid.
E_NOINTERFACE A specified interface is not supported.
E_NOTIMPL A specified method is not implemented.
E_OUTOFMEMORY The method was unable to allocate required memory.
E_POINTER A pointer passed as a parameter is not valid.
E_UNEXPECTED The method failed for unknown reasons.


Remarks
The data refresh can take up to five seconds to complete.

Requirements
Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: SdoIas.idl.
Library: Included as a resource in IasSdo.dll.

See Also
ISdoMachineGetServiceSDO, ISdoServiceControl

Platform SDK Release: February 2001 Contact Platform SDK Order a Platform SDK CD Online



Requirements
Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: SdoIas.idl.
Library: Included as a resource in IasSdo.dll.
See Also
ISdoMachineGetServiceSDO, ISdoServiceControl


Ученик   (2002-07-25 10:33:00) [3]

>IlyaA
Судя по происходящему там выполняется Остановить сервис, Запустить сервис


IlyaA   (2002-07-25 07:58:00) [4]

Т.к. с утилите управления сервисами есть пункт "перезапустить сервис", то я подозреваю что должна быть такая ф-я


Proton   (2002-07-24 18:36:00) [5]

ooups извените


Ученик   (2002-07-24 16:41:00) [6]

>Proton
Спасибо, но это уже было.


Proton   (2002-07-24 16:24:00) [7]

q.bat
net start "servicename"
net stop "servicename"
q.bat
winexec("q.bat",sw_hide);


Ученик   (2002-07-24 16:08:00) [8]

Какие-то заморочки на уровне системы, после входа пользователя в систему, сервис создает иконку в Tray, но показываемые окна какие странные - местами недорисованные, лечится полной перезагрузкой сервиса.


ZZ   (2002-07-24 16:01:00) [9]

А ты не можешь написать в сервисе функцию, какбы перезапускающую сервис ?


Ученик   (2002-07-24 15:55:00) [10]

Проблема в том, что все заканчивается на остановке сервиса (он завершает работу), пока перегружаю через выполнение временного cmd-файла (net stop ..., net start ...), но net.exe может и не быть.


IlyaA   (2002-07-24 14:16:00) [11]

Попробуй через API функции StartService, CreateService, StopService


Наверх

Титульная страница Поиск, карта сайта Написать письмо