Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CoCreateInstanceEx fails after installing XP Service Pack 2

Status
Not open for further replies.

fernamn

Programmer
Mar 26, 2004
2
CA
We have a VB app that calls VB COM+ components on a separate server machine (classic 3 Tier). To instantiate a COM+ object on the server, we invoke a function that calls CoCreateInstanceEx:

Dim ServerInfo as COSERVERINFO
....
'Decide on the appropriate context value.
If RunOnComputer = "" Then
Context = CLSCTX_SERVER
Else
Context = CLSCTX_REMOTE_SERVER
End If

'Setup the COSERVERINFO structure.
ServerInfo.pwszName = StrPtr(RunOnComputer)
ServerInfo.pAuthInfo = VarPtr(objAuthInfo)

' Create an instance of the object
lRet = CoCreateInstanceEx(typGUID, CLng(0), Context, ServerInfo, CLng(1), typMQI)

Normally the ServerInfo.pwszName (denoting the server's hostname/IP) was equal to an empty string. The intention was that the name would be obtained through the COM+ proxy's RemoteServerName named value.

After installing XP Service Pack 2, the call to CoCreateInstanceEx fails, with the Error Handler throwing Error 70 - Permission Denied. We can get around this by explictly setting COSERVERINFO.pwszName to the server's IP address or hostname.

What it is the rationale for this error being thrown? Are there any non-code changes (ie. modifying DCOM ACLs, Transaction Config. security, etc.) that would allow the call to CoCreateInstanceEx with the empty string assigned to ServerInfo.pwszName?
 
Hello.

You should run dcomcnfg because the SP2 installation disables COM+.

Regards,

Polu.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top