我在远程客户端创建DCOM,不成功,不能得到接口指针,错误提示:拒绝访问。安全性设置如: hr = CoInitializeSecurity(NULL, -1, NULL, NULL,
RPC_C_AUTHN_LEVEL_NONE, 
RPC_C_IMP_LEVEL_ANONYMOUS,NULL, EOAC_NONE, NULL);请问这是怎么回事?怎么解决?

解决方案 »

  1.   

    要不在com+的程序里添加用户,要不就使用guest用户,在windows下使guest用户可用。
      

  2.   

    非常非常感谢atdawn,这个问题困饶我好长时间!顺便再请教一下,如何使得在系统管理员身份登录时也能连接成功?一定要在程序里添加administrator用户吗?
      

  3.   

    U CAN use CoSetProxyBlanket  Look For MSDN
      

  4.   

    Turning Off Call Security
    Call security determines whether a client has permission to call a server's methods. There are two ways to disable call security: One involves using Dcomcnfg.exe to modify the registry, and the other requires calls to CoInitializeSecurity. Turning Off Call Security Using DCOMCNFG
    Call security can most easily be turned off by using Dcomcnfg.exe to modify the registry. However, using Dcomcnfg.exe to turn security off will work only if both the client and the server do not call CoInitializeSecurity. This is because when CoInitializeSecurity is called, DCOM ignores the registry settings and uses the values supplied to CoInitializeSecurity instead. To turn off security with Dcomcnfg.exe, both the client and the server must set their Authentication Levels to None. The following steps must be completed: Run Dcomcnfg.exe. 
    On the Applications page, select the application that represents the server. Click the Properties button (or double-click the selected application). 
    Click the General tab. 
    From the Default Authentication Level list box, select (None). 
    Click the Apply button to apply changes; however, changes are not applied to any running instances of the application. 
    If the client appears on the list on the Applications page, repeat steps 2 through 5, choosing the client instead of the server for step 2. Then click the OK button. If the client is not on the list, you can do one of the following three things: 
    You can set the client's Authentication Level to None on a machine-wide basis by using Dcomcnfg.exe. (See the warning and the procedure below.) 
    You can set the client's authentication level to None programmatically. (See Turning Off Call Security Programmatically.) 
    If you are using Microsoft® Windows NT® 4.0 SP4 or Microsoft Windows® 2000, you can create an AppID key for the client to indicate an authentication level of None. (See Setting Processwide Security Through the Registry.) 
    To set the Authentication Level to None on a machine-wide basis:Warning   Setting the machine-wide Authentication Level to None is extremely unsecure. Run Dcomcnfg.exe. 
    Choose the Default Properties tab. 
    From the Default Authentication Level list box, choose (None). 
    Click the OK button. 
    Turning Off Call Security Programmatically
    To turn call security off programmatically, both the client and the server must call CoInitializeSecurity, setting the authentication level in the dwAuthnLevel parameter to RPC_C_AUTHN_LEVEL_NONE. See Also
    Turning Off Activation Security详细内容
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/security_53sp.asp