BUG: 16-bit Custom Handler Not Loaded If 32-bit Handler Found

ID: Q139216

4.00    | 3.51
WINDOWS | WINDOWS NT kbole kbbuglist

The information in this article applies to:

- Microsoft OLE libraries included with:

   - Microsoft Windows NT version 3.51
   - Microsoft Windows 95 version 4.0

SYMPTOMS

An OLE object that provides a custom handler and needs to be embedded in 16- and 32-bit containers must provide a 16-bit and a 32-bit implementation of the handler. When such an object is created in a 16-bit container, the OleCreate function or its variant will return CO_E_ERRORINDLL.

CAUSE

An OLE object with 16-bit and 32-bit implementations of a custom handler will register the handlers as follows:

   HKEY_CLASSES_ROOT\CLSID\{...}\InProcHandler32 = HNDLR32.DLL
   HKEY_CLASSES_ROOT\CLSID\{...}\InProcHandler = HNDLR16.DLL

Hndlr32.dll is the 32-bit implementation of the handler and Hndlr16.dll is the 16-bit implementation of the handler.

OleCreate or its variants are supposed to load the 16-bit handler in a 16-bit container and the 32-bit handler in a 32-bit container. Because of a problem in OLE, the 16-bit handler is not loaded if a 32-bit handler is found in the registry. Consequently a 16-bit container will not be able to create the object. However a 32-bit container will be able to create the object.

The 16-bit container will be able to create the object if the InProcHandler32 registration is removed, but then a 32-bit container will not be able to create the object.

RESOLUTION

Register the handler as an in-process server instead of a handler as follows:

   HKEY_CLASSES_ROOT\CLSID\{...}\InProcServer32 = HNDLR32.DLL
   HKEY_CLASSES_ROOT\CLSID\{...}\InProcServer = HNDLR16.DLL

The handler will work correctly even though it is registered as an in-process server.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional reference words: 2.00 4.00 KBCategory: kbole kbbuglist KBSubcategory: LeTwoArc

Keywords          : LeTwoArc kbbuglist
Version           : 4.00    | 3.51
Platform          : NT WINDOWS

Last Reviewed: November 16, 1995