Board index » delphi » NT Service + COM Server Help!!

NT Service + COM Server Help!!

1. I have created an out of process COM Server(ciMultiInstance). No visual
behaviour
It works well & can interact between various clients. I was using a form to
do the initial development.
after that I remove the form, and started making it an NT Server

2. I want to make it a NT Service, so that it auto starts. I did this & the
NT service starts successfully
(configured as  Log On as System Account) The service starts successfully

3. I use a test application to create the COM object. Here another instance
of the exe starts
which dies(exits) after some time

AM I missing anything

TIA for any help

Manoj

 

Re:NT Service + COM Server Help!!


A COM/NT service also needs to have the LocalService subkey under the AppId.
You have to manually do that in D4. For info, go to my site and into the
downloads section: there's a simple sample there with readme instructions.

http://www.castle.net/~bly/com

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Quote
Manoj Champanerkar <mano...@yahoo.com> wrote in message

news:7rjfq6$5mb10@forums.borland.com...
Quote
> 1. I have created an out of process COM Server(ciMultiInstance). No visual
> behaviour
> It works well & can interact between various clients. I was using a form
to
> do the initial development.
> after that I remove the form, and started making it an NT Server

> 2. I want to make it a NT Service, so that it auto starts. I did this &
the
> NT service starts successfully
> (configured as  Log On as System Account) The service starts successfully

> 3. I use a test application to create the COM object. Here another
instance
> of the exe starts
> which dies(exits) after some time

> AM I missing anything

> TIA for any help

> Manoj

Re:NT Service + COM Server Help!!


Hi,

Read my article about services with com server on my site
http://www.chat.ru/~aldyn/svcom_frame_art.html
This problem is much more complex then it seems.

Regards,

Alexey Dynnikov <al...@chat.ru>
http://members.tripod.com/~aldyn
http://al.irt.ustu.ru/~aldyn/
http://www.chat.ru/~aldyn/
ICQ #18267212
SvCom - The Joy of Services

Manoj Champanerkar <mano...@yahoo.com> ???Y ?????
???Y??:7rjfq6$5m...@forums.borland.com...

Quote
> 1. I have created an out of process COM

Server(ciMultiInstance). No visual
Quote
> behaviour
> It works well & can interact between various clients. I
was using a form to
> do the initial development.
> after that I remove the form, and started making it an NT
Server

> 2. I want to make it a NT Service, so that it auto starts.
I did this & the
> NT service starts successfully
> (configured as  Log On as System Account) The service
starts successfully

> 3. I use a test application to create the COM object. Here
another instance
> of the exe starts
> which dies(exits) after some time

> AM I missing anything

> TIA for any help

> Manoj

Re:NT Service + COM Server Help!!


My Server is not in the AppID section of the registry. The
DCOMHelloWorldService.Object1 comes. It is also not visible in the DCOMCNFG
tool.

Is there anything I need to do for this ? (My Server has two automation
objects in it.)

Manoj

Re:NT Service + COM Server Help!!


I Got it working. Some snafu in the EXE (It was a ActiveX DLL project which
I changed by hand to program in the project source).
I created a new Service Application & added the com objects in this.
Everything worked.

Thanks a lot Binh

Manoj

Quote
Manoj Champanerkar <mano...@yahoo.com> wrote in message

news:7rlsv1$qqb5@forums.borland.com...
Quote
> My Server is not in the AppID section of the registry. The
> DCOMHelloWorldService.Object1 comes. It is also not visible in the
DCOMCNFG
> tool.

> Is there anything I need to do for this ? (My Server has two automation
> objects in it.)

> Manoj

Re:NT Service + COM Server Help!!


What is the criteria for an item appearing in the AppID RegKey, when a
Comserver is registered ?

Does Delphi (generated code i.e. applicaiotn) creates the entry, or is it
done be one of windows API calls ?

Manoj

Re:NT Service + COM Server Help!!


The server is supposed to register its AppId. But DCOMCNFG is smart enough
to put one in for you if you don't have one - I think it picks the lowest
valued CLSID in your server and uses that as your server's AppId.

As of D4, the VCL source does not register the AppId. I believe D5 has a
function that puts in the LocalService key into the AppId.

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Quote
Manoj Champanerkar <mano...@yahoo.com> wrote in message

news:7roc2p$fg521@forums.borland.com...
Quote
> What is the criteria for an item appearing in the AppID RegKey, when a
> Comserver is registered ?

> Does Delphi (generated code i.e. applicaiotn) creates the entry, or is it
> done be one of windows API calls ?

> Manoj

Re:NT Service + COM Server Help!!


Yes Binh, Thats the way it works. Thanks.

To accelerate the process
1. I create the APPID entries myself with the Class GUID (The lowest one), &
LocalService in my Service event AfterInstall usig TRegistry...
2. I then just run dcomcnfg & close it.

The above approach works & I feel shortens the admin work when I want to
deploy the components on the Production server.

As a precaution, I remove the APPID entry in the AfetUnInstall Event.

Manoj

Quote
Binh Ly <b...@castle.net> wrote in message

news:7rod65$i7r1@forums.borland.com...
Quote
> The server is supposed to register its AppId. But DCOMCNFG is smart enough
> to put one in for you if you don't have one - I think it picks the lowest
> valued CLSID in your server and uses that as your server's AppId.

> As of D4, the VCL source does not register the AppId. I believe D5 has a
> function that puts in the LocalService key into the AppId.

> have fun
> --
> Binh Ly
> Visit my COM Notes at http://www.castle.net/~bly/com

> Manoj Champanerkar <mano...@yahoo.com> wrote in message
> news:7roc2p$fg521@forums.borland.com...
> > What is the criteria for an item appearing in the AppID RegKey, when a
> > Comserver is registered ?

> > Does Delphi (generated code i.e. applicaiotn) creates the entry, or is
it
> > done be one of windows API calls ?

> > Manoj

Other Threads