PRB: Registering ATL Server Causes 0x80040154 Error

ID: Q201191


The information in this article applies to:
  • The Microsoft Active Template Library (ATL), versions 2.0, 2.1, 3.0, included with:
    • Microsoft Visual C++, 32-bit Editions, versions 5.0, 6.0


SYMPTOMS

When you register an ATL server, you might get error 0x80040154 (Class not registered). For DLLs, REGSVR32.exe returns this error. For .exes, the call to _Module::RegisterServer(CComModule::RegisterServer) in _tWinMain() returns this error.


CAUSE

ATL.dll is not installed, or it is not registered.


RESOLUTION

Install ATL.dll in the Windows\System or Winnt\System32 directory and register it using REGSVR32.exe. There are UNICODE and ANSI versions of ATL.dll. Install the appropriate version on the target operating system (that is, UNICODE for Windows NT and ANSI for Windows 95 or Windows 98).

As an alternative, do not use ATL.dll. When you rebuild your ATL server with a build target of ReleaseMinDependency, the code in ATL.dll is statically linked to your project.

Even for a 'Release MinDependency' ATL.dll may need to be shipped.


STATUS

This behavior is by design.


MORE INFORMATION

ATL has a registrar component that is used during registration. This component resides in ATL.dll. During registration, the error 0x80040154 is returned from CoCreateInstance() when it fails to create the registrar component.

Location of ATL.DLL in the VC 5.0 CD:

OS\SYSTEM (UNICODE version)
OS\SYSTEM\ANSI (ANSI version)

Location of ATL.DLL in the VC 6.0 CD:

DevStudio\VC\Redist (UNICODE version)
DevStudio\VC\Redist\Ansi (ANSI version)


REFERENCES

MSDN Library: Registrar, ATL Registry Component; Regsvr32, using

(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Samson Tanrena, Microsoft Corporation.

Additional query words: REGDB_E_CLASSNOTREG

Keywords : kbActiveX kbATL200 kbATL210 kbCOMt kbCtrlCreate kbInprocSvr kbRegistry kbVC500 kbVC600 kbATL300 kbfaq
Version : WINDOWS:2.0,2.1,3.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: January 27, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.