E_ACCESSDENIED exception when attaching to an event in a COM server from .NET
I have a C++/ATL COM server that implements IConnectionPoint events. My client is a C# application that attaches to the events. When the COM server is created as a SYSTEM service, the client can properly attach to the event. W开发者_运维知识库hen the COM server is created as a LocalService service (preferred), then I get an E_ACCESSDENIED exception when I attach to the event.
What can I do to get the events to work when the COM server is LocalService?
Thanks.
You'll need to find what user the LocalService is attemping to use, and ensure that user has access. If you can't adjust access for the whole computer, you may have to do it programatically using CoInitializeSecurity
and using an identity that is known to have access.
Refer to http://msdn.microsoft.com/en-us/library/ms679760(v=VS.85).aspx for more information.
精彩评论