BUG: 16-bit Custom Handler Not Loaded If 32-bit Handler Found (139216)
The information in this article applies to:
- Microsoft OLE Libraries, when used with:
- the operating system: Microsoft Windows NT 3.51
- the operating system: Microsoft Windows NT 4.0
- the operating system: Microsoft Windows 95
This article was previously published under Q139216 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. This was corrected for build 1264.
The same fixes have been applied to the Nashville version of OLE32.
| Modification Type: | Major | Last Reviewed: | 12/3/2003 |
|---|
| Keywords: | kbBug KB139216 |
|---|
|