PRB: ATL COM Object Fails to Register (297323)



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 3.0

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\<platform name>\TARGET\<CPU type> 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]
@="Registrar Class"

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

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

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

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

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

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

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.

REFERENCES

For more information on UpdateRegistryFromResource, see the API Reference for the function in eMbedded Visual Tools 3.0 Help.

Modification Type:MinorLast Reviewed:8/18/2005
Keywords:kbprb KB297323