Microsoft KB Archive/297323

= PRB: ATL COM Object Fails to Register =

Article ID: 297323

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Encarta Reference Suite 2001

-



This article was previously published under Q297323



SYMPTOMS
A COM server based on Active Template Library (ATL) fails to register on Windows CE. The _Module.UpdateRegistryFromResource function may return the error code 0x80040154 (REGDB_E_CLASSNOTREG).



CAUSE
ATLCE300.dll has not been registered. By default, Windows CE platforms that include the ATL runtime support do not have ATLCE300.dll registered.



RESOLUTION
There are two ways to register ATLCE300.dll:
 * Use the Regsvrce.exe utility to register ATLCE300.dll.
 * Include the registry entries that expose the ATL.Registrar object, which is served by ATLCE300.dll, in your Platform.reg file.



MORE INFORMATION
The _Module.UpdateRegistryFromResource function is used by COM objects that are implemented as a local server.

The regsvrce.exe utility can be found in the C:\Windows CE Tools\Wce300\ \TARGET\ directory of your installed custom SDK directory tree.

The follow registry entries can be placed in your PLATFORM.reg file so that it is not necessary to manually register ATLCE300.dll by using Regsrvce.exe.

; registry entries for ATLCE300.DLL [HKEY_CLASSES_ROOT\ATL.Registrar] @=&quot;Registrar Class&quot;

[HKEY_CLASSES_ROOT\ATL.Registrar\CLSID] @=&quot;{44EC053A-400F-11D0-9DCD-00A0C90391D3}&quot;

[HKEY_CLASSES_ROOT\CLSID\{44EC053A-400F-11D0-9DCD-00A0C90391D3}] @=&quot;Registrar Class&quot;

[HKEY_CLASSES_ROOT\CLSID\{44EC053A-400F-11D0-9DCD-00A0C90391D3}\InprocServer32] @=&quot;atlce300.dll&quot; &quot;ThreadingModel&quot;=&quot;Both&quot;

[HKEY_CLASSES_ROOT\CLSID\{44EC053A-400F-11D0-9DCD-00A0C90391D3}\ProgID] @=&quot;ATL.Registrar&quot;

[HKEY_CLASSES_ROOT\TypeLib\{44EC0535-400F-11D0-9DCD-00A0C90391D3}\1.0\0] @=&quot;atlce300.dll&quot;

[HKEY_CLASSES_ROOT\TypeLib\{44EC0535-400F-11D0-9DCD-00A0C90391D3}\1.0\0\Win32] @=&quot;atlce300.dll&quot;

Platform Builder 3.0 comes with two ATL local server COM examples. The samples, DLGSVR and NUMGEN, can be found in the \WINCE300\OTHERS\SAMPLES\ATL folder.

There may be other reasons why _Module.UpdateRegistryFromResource may fail indicated by different return error codes.

