Microsoft KB Archive/305746

= BUG: &quot;Access Denied&quot; Error Message in Response to DCOM Activation for ATL-Built COM Servers =

Article ID: 305746

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows NT Server 4.0, Terminal Server Edition
 * Microsoft Windows 2000 Professional Edition
 * Microsoft COM+ 2.0 Standard Edition
 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows Millennium Edition
 * Microsoft Windows 98 Standard Edition
 * Microsoft Windows 95

-



This article was previously published under Q305746



SYMPTOMS
DCOM activation for Active Template Library (ATL)-built COM servers may fail with the following error message:

0x80070005 (E_ACCESSDENIED)



CAUSE
This behavior can occur if there is a short-file-name versus long-file-name conflict in the registry.

COM servers are registered under the HKEY_CLASSES_ROOT\AppID key in a named value that indicates the module name (such as OUROLEAPP.EXE). This type of named value is REG_SZ, and it contains the string representation of the AppID associated with the executable. This mapping is used to obtain the default access permissions and authentication level. An ATL server with a long file name is registered under the CLSID\LocalServer32 key with a short file name (OUROLE~1.EXE). However, when the Dcomcnfg utility creates the mapped executable name for the server in the registry that points to the actual AppID key of the server, it uses the long file name (OUROLEAPP.EXE).



RESOLUTION
To work around this issue, use either of the following methods:
 * Add an additional key, HKEY_CLASSES_ROOT\AppID\OUROLE~1.EXE, that maps to the same AppID as HKEY_CLASSES_ROOT\AppID\OUROLEAPP.EXE.

This is the preferred method.

-or-
 * Rename the HKEY_CLASSES_ROOT\AppID\OUROLEAPP.EXE as HKEY_CLASSES_ROOT\AppID\OUROLE~1.EXE.

NOTE: Use project names that are eight characters or less when you create ATL-built COM servers.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

