Re:Service interacts with COM
If you use COM in a service you should CoInitialize before you do any COM
related calls.
I built a service which calls Word (through COM) and prints a document. A
week ago the
service was running on a newly installed machine. Printers were installed
under the Administrator
profile. The result was that the service could not access the printer. The
service was running under
a different user.
I you want access to all applications etc. available to a specific user, you
should run the service
under that user profile.
Marian Wendt heeft geschreven in bericht
<95sbku$rp7$0...@news.t-online.com>...
Quote
>Hallo,
>3 weeks ago I posted a question about use of a COM application from a
>service. Binh Ly asked me back if the interactive flag was set properly to
>the service and I told him that this was done. In the meantime I think I
>know the reason why the scenario do not work.
>I will describe again:
>If I create the COM application by calling from my service application all
>works well - but if the COM application was started before (user call) then
>it do not work.
>So I suggest that there is a security problem. The service start as "user"
>named "LocalSystem" but the COM application run under the user who started
>it (myself as logged on) - so they are in different security environments.
>If that was right recognized, how coult my service application access the
>COM application?
>Must I manipulate some security "parameters" and if so which and how?
>Has anyone experinced similar problems?
>Thanks
>Marian