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

Last reviewed: November 14, 1995
Article ID: Q139216
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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 14, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.