1
votes

I have a WPFApplication coded in c# to access a COM component. I have added reference to the COM component from my app. When I have both client(my app) and server(com) in same machine it works as expected. The problem is when they are on different machines. Both machines are identical, I mean have Windows 7 OS. And both on same domain. I tried to create an instance of the com component with below code and it gives me no error

IPDSIntf test; 
string clsId = "85689616-277B-4E00-9A5E-19AD78E7E0E2";
var type = Type.GetTypeFromCLSID(new Guid(clsId), MachineName, true);
                var COMObject = Activator.CreateInstance(type);
                test = (IPDSIntf)COMObject;

Now when I call any method in the COM. say test.Connect(clientId, errorCode), I am getting exception 'Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))'.

Have set many permission, gave admin privilege to my user account on the server machine, added my account to 'Distributed COM Users' group etc... But still getting same issue. For all type of users(anonymous, network, everyone...), gave 'local and remote' access in COM security option of the server computer, through DCOMCNFG and all that saw when did google search. Firewall is turned off in both client and server.

Now left with no option to try.I am running out of time to fix it and have already spent 4 days on the same, googling. But no luck.

One more thing, is I could not see my COM in DCOMCNFG, means it is not registered? What could be the reason for it. I believe all COM component in machine will be registered in component services. Need some clarification on this too as I doubt it has some relation with my issue.

Thanks In advance, Nishitha

2
Try to start your VS in admin mode. Are the users are identical on both machines?ervinbosenbacher
And despite the fact that it says access denied might be a dependency issue. Have a look at this article, might give some clues, though it is java based. (j-integra.intrinsyc.com/support/com/doc/remoteaccess.html)ervinbosenbacher
Thanks xebo . Started visual studio in Admin mode as well. No luck. Yes, its the same user in both client and server. Let me go through that link too...nishitha nair
the the 'same machine config' work on both machines?Preet Sangha
Does this work in PowerShell? $updatesession = [activator]::CreateInstance([type]::GetTypeFromProgID("Your.Prog.ID.Here", "machinename"))Mark Richman

2 Answers

0
votes

Hi this error was given to me doing same thing but on a Excel Application. I found that excel COM was actually a 32 bit one and needed to access the 32 bit DECOM configurations.

You can access 32bit DECOM configurations by entering "comexp.msc /32" command on the run.

Then you'll find "Microsoft xxx Application". In my case it was Microsoft Excel Application, under the DECOM configurations. On the properties I've made all the securities to Custom and Identity in the Identity tab to "The Interactive User".

Then it worked for me. Hope this will help you too.

0
votes

I have answer for some part of your question.

Your component is not listed in DCOM probably because it might be an Activex dll.Follow these steps to make it listed in dcom.

Start-->Run-->oleview-->Object Classes-->All Objects (Expand) Select your COM in left pane. Click on Implementation tab on right pane and check "Use Surrogate Process" Close oleview and opn dcomcnfg, your COM might be listed there.

I am having exactly same setup and facing the exactly same error 0x80070005 and has tried all possible configurations available. Please let me know whether you have found the root cause to overcome this access denied issue. I have already spend 4 days on this :-)