Board index » delphi » HELP - Delphi 4 Automation Server over NT Service

HELP - Delphi 4 Automation Server over NT Service

Hi ALL,
I like to create Automation server over NT SERVICE with
DELPHI 4.
Is it possible?
Please for HELP, HELP, HELP!!!
 

Re:HELP - Delphi 4 Automation Server over NT Service


Hi Munco,

Yup, it is possible, and to be honest Delphi 4 makes it incredibly easy,
although I found that there's almost no documentation...

Just create a TServiceApplication and then add Automation service like a
normal application. ;-)

If you haven't got Client/Server Delphi, then I've written some Service
Components that will do the trick but my recommendation is to upgrade. If
you are interested, drop me a note...

mknel...@netcomuk.co.uk

Quote
Munco wrote in message <71v6g4$i...@forums.borland.com>...
>Hi ALL,
>I like to create Automation server over NT SERVICE with
>DELPHI 4.
>Is it possible?
>Please for HELP, HELP, HELP!!!

Re:HELP - Delphi 4 Automation Server over NT Service


Hello,

What problems do you have? Just create a service app. Add ActiveX objects to
it. Register your service. And manually configure the LocalService string
value for your AppId in the registry.

have fun
--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
Munco wrote in message <71v6g4$i...@forums.borland.com>...
>Hi ALL,
>I like to create Automation server over NT SERVICE with
>DELPHI 4.
>Is it possible?
>Please for HELP, HELP, HELP!!!

Re:HELP - Delphi 4 Automation Server over NT Service


PLEASE FOR MORE INFO!!!!

1. I CREATE EMPTY SERVICE WITH D4 WIZARD. IT IS UNIT1.PAS
2. I INSTALL SERVICE. OK! SERVICE WORK!!!!!
3. UNINSTALL SERVICE.
4. I CREATE AUTOMATION SERVER WITH D4 WIZARD.
5. ADD PROPERTIES, FUNCTIONS AND ETC. IN AUTOMATION SERVER. OK.   UNIT2.PAS
6. BUILD PROJECT AGAIN.
7. INSTALL SERVICE AGAIN. OK.
8. LUNCH SERVICE BY CLIENT PROGRAM.
9. CALL METHOD 'BLAH'.
10. METHOD 'BLAH' RETURN RESULT. OK.
11. I NOT FREE SERVER.
12. AFTER 20 SEC. I RECEIVE 'COM ERROR........' AND DCOM SERVER IS SHUT
DOWN.

Quote
bly wrote in message <72drb0$a2...@forums.borland.com>...
>Hello,

>What problems do you have? Just create a service app. Add ActiveX objects
to
>it. Register your service. And manually configure the LocalService string
>value for your AppId in the registry.

>have fun
>--
>Binh Ly
>Brickhouse Data Systems, Inc.
>http://www.brickhouse.com
>Munco wrote in message <71v6g4$i...@forums.borland.com>...
>>Hi ALL,
>>I like to create Automation server over NT SERVICE with
>>DELPHI 4.
>>Is it possible?
>>Please for HELP, HELP, HELP!!!

Re:HELP - Delphi 4 Automation Server over NT Service


Hello,

Like I said, you will also need to manually configure the LocalService
string value for your server's AppID key in the registry. That will fix your
"ComServer terminating..." error.

have fun
--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
Munco wrote in message <72e7cr$b...@forums.borland.com>...
>PLEASE FOR MORE INFO!!!!

>1. I CREATE EMPTY SERVICE WITH D4 WIZARD. IT IS UNIT1.PAS
>2. I INSTALL SERVICE. OK! SERVICE WORK!!!!!
>3. UNINSTALL SERVICE.
>4. I CREATE AUTOMATION SERVER WITH D4 WIZARD.
>5. ADD PROPERTIES, FUNCTIONS AND ETC. IN AUTOMATION SERVER. OK.   UNIT2.PAS
>6. BUILD PROJECT AGAIN.
>7. INSTALL SERVICE AGAIN. OK.
>8. LUNCH SERVICE BY CLIENT PROGRAM.
>9. CALL METHOD 'BLAH'.
>10. METHOD 'BLAH' RETURN RESULT. OK.
>11. I NOT FREE SERVER.
>12. AFTER 20 SEC. I RECEIVE 'COM ERROR........' AND DCOM SERVER IS SHUT
>DOWN.

>bly wrote in message <72drb0$a2...@forums.borland.com>...
>>Hello,

>>What problems do you have? Just create a service app. Add ActiveX objects
>to
>>it. Register your service. And manually configure the LocalService string
>>value for your AppId in the registry.

>>have fun
>>--
>>Binh Ly
>>Brickhouse Data Systems, Inc.
>>http://www.brickhouse.com
>>Munco wrote in message <71v6g4$i...@forums.borland.com>...
>>>Hi ALL,
>>>I like to create Automation server over NT SERVICE with
>>>DELPHI 4.
>>>Is it possible?
>>>Please for HELP, HELP, HELP!!!

Re:HELP - Delphi 4 Automation Server over NT Service


bly,

Sorry but your advices about DCOM server in a service are incorrect. Of
course the AppID key is neccessary but the problem is more complicated. The
thing is that the ComServ unit that comes with Delphi CAN NOT be used to
create DCOM server in a service. To make shure in it take a look on the
ComServ unit and you will see that the svcmgr unit is not included into uses
section of ComServ. Conclusion is : ComServ does know nothing about services
so it can't create a com-object in the SERVICE thread. All that it can to do
is to create a com-object in the CONTROL thread of service application. It
is a thread in which Application.Run is called. This thread terminates after
starting a service itself and the ComServ shows a warning at this moment.
You can disable the termination of the control thread but it does not mean
that your DCOM server works as service.

Now a few words about the correct solution. At first, las week I've sent
several emails with a simple example that REALLY creates a DCOM server in
the service. At the second, I am going to publish some my ideas about it on
my homepage http://www.chat.ru/~aldyn. I hope that it will occur on this
week. There will be : 1) a short discussion of problem; 2) serveral units
(replacement of ComServ) and Delphi wizard for creating DCOM servers in a
service. In fact it is ready for upload now but html... I am not experienced
with web-pages creation and it takes a lot of time for me.

Regards.

--
Alexey A. Dynnikov <al...@chat.ru>
http://www.chat.ru/~aldyn
ICQ 18267212

Quote
bly wrote in message <72nls1$o...@forums.borland.com>...
>Like I said, you will also need to manually configure the LocalService
>string value for your server's AppID key in the registry. That will fix
your
>"ComServer terminating..." error.

Re:HELP - Delphi 4 Automation Server over NT Service


Hello,

I'm not sure what you mean. I have a simple Delphi 4 (update pack 2) created
COM server service demo at my site. Download DCOMHelloWorldSvc.zip from

http://www.castle.net/~bly/Programming/Delphi

have fun,
--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
Alexey A. Dynnikov wrote in message <72oke7$p...@forums.borland.com>...
>bly,

>Sorry but your advices about DCOM server in a service are incorrect. Of
>course the AppID key is neccessary but the problem is more complicated. The
>thing is that the ComServ unit that comes with Delphi CAN NOT be used to
>create DCOM server in a service. To make shure in it take a look on the
>ComServ unit and you will see that the svcmgr unit is not included into
uses
>section of ComServ. Conclusion is : ComServ does know nothing about
services
>so it can't create a com-object in the SERVICE thread. All that it can to
do
>is to create a com-object in the CONTROL thread of service application. It
>is a thread in which Application.Run is called. This thread terminates
after
>starting a service itself and the ComServ shows a warning at this moment.
>You can disable the termination of the control thread but it does not mean
>that your DCOM server works as service.

>Now a few words about the correct solution. At first, las week I've sent
>several emails with a simple example that REALLY creates a DCOM server in
>the service. At the second, I am going to publish some my ideas about it on
>my homepage http://www.chat.ru/~aldyn. I hope that it will occur on this
>week. There will be : 1) a short discussion of problem; 2) serveral units
>(replacement of ComServ) and Delphi wizard for creating DCOM servers in a
>service. In fact it is ready for upload now but html... I am not
experienced
>with web-pages creation and it takes a lot of time for me.

>Regards.

>--
>Alexey A. Dynnikov <al...@chat.ru>
>http://www.chat.ru/~aldyn
>ICQ 18267212
>bly wrote in message <72nls1$o...@forums.borland.com>...
>>Like I said, you will also need to manually configure the LocalService
>>string value for your server's AppID key in the registry. That will fix
>your
>>"ComServer terminating..." error.

Other Threads