PRB: Unicode ChooseColor() Help Button May Crash Common Dialog

Last reviewed: November 2, 1995
Article ID: Q102026
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) for Windows NT, versions 3.1, 3.5, and 3.51

SYMPTOMS

A Unicode compiled program, or a program that explicitly calls the ChooseColorW() function, may suffer an access violation in the common dialog boxes if the Help button in the ChooseColor() dialog box is chosen.

CAUSE

This problem may not be 100-percent reproducible. Because of the way that the program loader loads code into memory, a certain address referenced by the common dialog box Help button logic may or may not be valid depending on what other applications have been run, what application is calling ChooseColorW(), and the order in which these programs are run.

WORKAROUND

The following are suggested workarounds:

  • Try running an ANSI-compiled application that uses the common dialog boxes, and open one of the common dialog boxes before you run the application having this problem.
  • A workaround for new applications developers is to call ChooseColorW() with a hook function (see the Windows Software Development Kit documentation for more information on common dialog box hook functions), handle the Help button logic, and return TRUE from the hook function to bypass the standard common dialog box push-button code.


Additional reference words: 3.10 3.50
KBCategory: kbprg kbprb
KBSubCategory: UsrCmnDlg


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 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.