Microsoft KB Archive/251402

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 19:15, 16 July 2020 by X010 (talk | contribs) (1 revision imported: importing part 1)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

PRB: Windows Hook Stops Responding in a 16-Bit Application

Q251402



The information in this article applies to:


  • Microsoft Windows Software Development Kit (SDK) 4.0, on platform(s):
    • Microsoft Windows 98
    • Microsoft Windows 95





SYMPTOMS

A global Windows hook, for example a mouse hook, stops responding (crashes) when triggered by a 16-bit application.



CAUSE

The problem occurs when the hook dynamic-link library (DLL) is built by using the Visual C++ 6.0 Service Pack 2 (SP2) development environment. The problem also occurs when the hook project is using the multithreaded DLL C run-time library (/MD) option.

The Libcmt.lib file that is replaced by SP2 has a bug that can cause this type of behavior. The versions of Libcmt.lib from SP1 and SP3 do not exhibit this behavior.



RESOLUTION

To prevent this problem, do not use Libcmt.lib from Visual C++ version 6.0 SP2. Either install Visual C++ 6.0 SP1 or Visual C++ 6.0 SP3, or use Libcmt.lib from a Visual C++ 6.0 SP1 or SP3 installation and rebuild the DLL.

If you are using the /MD or multithreaded DLL C run-time library option, you must switch to the static multithreaded option (/MT).



STATUS

This problem is caused by a regression bug in the Visual C++ version 6.0 SP2 development environment.



MORE INFORMATION

Steps to Reproduce Behavior

  1. Build a system-wide keyboard/mouse hook by using Visual C++ 6.0 SP2.
  2. Install the system-wide hook.
  3. Start any 16-bit application.
  4. When mouse (in the case of a mouse hook) or keyboard (in the case of a keyboard hook) input occurs on the 16-bit application, the program stops responding (crashes).

Alternatively:

  1. Build a system-wide keyboard/mouse hook by using the /MD compiler switch.
  2. Install the system-wide hook.
  3. Start any 16-bit application.
  4. When mouse (in the case of a mouse hook) or keyboard (in the case of a keyboard hook) input occurs on the 16-bit application, the program stops responding (crashes).

Additional query words:

Keywords : kbHook kbGrpDSUser kbOSWin95 kbOSWin98 kbDSupport
Issue type : kbprb
Technology : kbAudDeveloper kbSDKSearch kbWinSDKSearch


Last Reviewed: December 15, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.