Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have built and registered a DCOM App,then I could find my DCOMApp in "DCOM Config" of "DCOMCNFG.exe".

Here is the problem:
I deploy my DCOMApp on WindowsXP(with out config anything just register DCOM),and test client visit from Windows7 on another computer.In this situation, my DCOMApp works fine on WindowsXP.

But I deploy my DCOMApp on Windows7(Ultimate 7600), and test client visit from WindowsXP, I always get a HRESULT=0x80070005 error after calling CoCreateInstanceEx.

I use excactly the same Test Client and DCOM Server Exe, just switch there deploying position.

I have tried some tips from google, such as:
http://www.computerperformance.co.uk/Logon/code/code_80070005.htm
http://www.opcactivex.com/Support/Tutorials/DCOM_Tutorial_-_Configuring_th/dcom_tutorial_-_configuring_th.html

But the problem is still there.

What shuold I do to fix this ?

PS: My Test Client CoCreateInstanceEx call:
CoInitialize(NULL);
	HRESULT hr=S_OK;
	MULTI_QI mqi[]={{&IID_ITestGetOsVersionV2,NULL,0}};//Only One Interface
	COSERVERINFO SrvInfo={0};//other member can be NULL/Zero
	SrvInfo.pwszName=L"192.168.0.1";	
	hr=CoCreateInstanceEx(CLSID_TestGetOsVersionV2,NULL,CLSCTX_ALL,&SrvInfo,
		sizeof(mqi)/sizeof(mqi[0]),mqi);//here,always 0x80070005.......
	if (SUCCEEDED(hr)){.....................}
Posted
Updated 8-Jun-11 21:24pm
v2

The only extra step I've had to employ when installing our DCOM server on a win7 machine is to tell the firewall to let the exe out, but that said, our DCOM server also becomes a callback client to the originating caller

0x80070005is invariably a problem with the configuration of your APPID

Make sure that your clsid references your appid, and in dcomcnfg make sure the GUID quoted in your app is your appid (dcomcnfg has a wonderful ?feature? where it invents an appid for your object if one wasn't specified - very confusing)

Then it's a case of setting security options for your app; you must also make sure the default machine limit allows those options

i.e. if you add StanSmith to remotely activate your app, that account must also exist in the Limit's for remote Activation
 
Share this answer
 
Comments
GhostEx 9-Jun-11 6:47am    
I found that all of DCOM Component on Windows7 can't be accessed from remote computer, even the system-built-in DCOM components. Is Windows7 disabled DCOM by default?
Dear barneyman, thanks for your reply.

Does "your clsid references your appid" mean like this?
MYDOMAPP.rgs file:
HKCR
{
NoRemove AppID
{
{7AA28EDE-49D0-4DC1-95AD-3E697CBBED90} = s 'TestGetOSVerV2'
'TestGetOSVerV2.EXE'
{
val AppID = s {7AA28EDE-49D0-4DC1-95AD-3E697CBBED90}
}
}
}
CLSID rgs file:
HKCR
{
TestGetOSVerV2.TestGetOsVersionV2.1 = s 'TestGetOsVersionV2 Class'
{
CLSID = s '{A4823774-CDC7-4161-8C76-BA93344402E5}'
}
TestGetOSVerV2.TestGetOsVersionV2 = s 'TestGetOsVersionV2 Class'
{
CLSID = s '{A4823774-CDC7-4161-8C76-BA93344402E5}'
CurVer = s 'TestGetOSVerV2.TestGetOsVersionV2.1'
}
NoRemove CLSID
{
ForceRemove {A4823774-CDC7-4161-8C76-BA93344402E5} = s 'TestGetOsVersionV2 Class'
{
ProgID = s 'TestGetOSVerV2.TestGetOsVersionV2.1'
VersionIndependentProgID = s 'TestGetOSVerV2.TestGetOsVersionV2'
ForceRemove 'Programmable'
LocalServer32 = s '%MODULE%'
val AppID = s '{7AA28EDE-49D0-4DC1-95AD-3E697CBBED90}' //appid should be refered here ???
'TypeLib' = s '{F7B530C2-403A-4072-9835-B18803D3B165}'
}
}
}
 
Share this answer
 
Comments
barneyman 9-Jun-11 19:23pm    
yes - that's correct

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900