помогите разобраться с примером сервиса
http://www.podgoretsky.com/ftp/Docs/Delphi/D5/dg/buildap.html
"Service threads
Each service has its own thread (TServiceThread), so if your service application implements more than one service you must ensure that the implementation of your services is thread-safe. TServiceThread is designed so that you can implement the service in the TService OnExecute event handler. The service thread has its own Execute method which contains a loop that calls the service's OnStart and OnExecute handlers before processing new requests. Because service requests can take a long time to process and the service application can receive simultaneous requests from more than one client, it is more efficient to spawn a new thread (derived from TThread, not TServiceThread) for each request and move the implementation of that service to the new thread's Execute method. This allows the service thread's Execute loop to process new requests continually without having to wait for the service's OnExecute handler to finish. The following example demonstrates.
Example: This service beeps every 500 milliseconds from within the standard thread. It handles pausing, continuing, and stopping of the thread when the service is told to pause, continue, or stop.
Choose File|New and select Service Application from the New Items dialog. You will see a window appear named Service1.
In the interface section of your unit, declare a new descendant of TThread named TSparkyThread. This is the thread that does the work for your service. The declaration should appear as follows:
TSparkyThread = class(TThread)
public
procedure Execute; override;
end;
"
и т.д.
но он на Delfях, как этот же пример будет выглядеть в Builder C++?
Есть пример на
"Service threads
Each service has its own thread (TServiceThread), so if your service application implements more than one service you must ensure that the implementation of your services is thread-safe. TServiceThread is designed so that you can implement the service in the TService OnExecute event handler. The service thread has its own Execute method which contains a loop that calls the service's OnStart and OnExecute handlers before processing new requests. Because service requests can take a long time to process and the service application can receive simultaneous requests from more than one client, it is more efficient to spawn a new thread (derived from TThread, not TServiceThread) for each request and move the implementation of that service to the new thread's Execute method. This allows the service thread's Execute loop to process new requests continually without having to wait for the service's OnExecute handler to finish. The following example demonstrates.
Example: This service beeps every 500 milliseconds from within the standard thread. It handles pausing, continuing, and stopping of the thread when the service is told to pause, continue, or stop.
Choose File|New and select Service Application from the New Items dialog. You will see a window appear named Service1.
In the interface section of your unit, declare a new descendant of TThread named TSparkyThread. This is the thread that does the work for your service. The declaration should appear as follows:
TSparkyThread = class(TThread)
public
procedure Execute; override;
end;
"
и т.д.
но он на Delfях, как этот же пример будет выглядеть в Builder C++?
http://www.rsdn.ru есть несколько детальных статей по сервисам, советую почитать.
Если не найдете, могу завтра ссылки скинуть.
На
Если не найдете, могу завтра ссылки скинуть.
http://www.podgoretsky.com/ftp/Docs/Delphi/D5/dg/buildap.html
...
и т.д.
но он на Delfях, как этот же пример будет выглядеть в Builder C++?[/QUOTE]
http://www.google.ru/search?hl=ru&q=TService+AND+Builder&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%B2+Google&lr=
[QUOTE=j_anna]Есть пример на
...
и т.д.
но он на Delfях, как этот же пример будет выглядеть в Builder C++?[/QUOTE]
http://www.google.ru/search?hl=ru&q=TService+AND+Builder&btnG=%D0%9F%D0%BE%D0%B8%D1%81%D0%BA+%D0%B2+Google&lr=