PRB: GPF When MultiColumn & LBS_OWNERDRAWVARIABLE in List Box

Last reviewed: July 10, 1997
Article ID: Q129494
1.00 1.50 1.51 1.52 | 1.00 2.00 2.10 4.00
WINDOWS             | WINDOWS NT
kbtool kbprb

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with:

        - Microsoft Visual C++ for Windows, versions 1.0 1.5 1.51 1.52
        - Microsoft Visual C++, 32-bit Edition, versions 1.0 2.0 2.1, and
          4.0
    

SUMMARY

A General Protection Fault (GPF) or Application Error will occur when attempting to display a dialog or FormView that contains a list box with both the multicolumn (LBS_MULTICOLUMN) and ownerdraw, variable height (LBS_OWNERDRAWVARIABLE) styles.

CAUSE

This is expected behavior. Windows, Windows NT, and Windows 95 do not support multicolumn, ownerdraw, variable height list boxes.

RESOLUTION

For listboxes that are owner drawn and multicolumn, use the fixed height style (LBS_OWNERDRAWFIXED).

For listboxes that are owner drawn and use the variable height style (LBS_OWNERDRAWVARIABLE), do not use the multicolumn style (LBS_MULTICOLUMN).

MORE INFORMATION

The Dialog Editor that ships with all versions of Visual C++ prior to version 4.0 incorrectly allow these incompatible styles to be combined using the check boxes on the property page for the list box control. (Visual C++, 32-bit Edition, version 4.0 disables the Multi-column check box when Variable is the setting selected for Owner draw.) These styles, LBS_MULTICOLUMN and LBS_OWNERDRAWVARIABLE, may also be combined incorrectly if the dialog box resource file (.RC) is edited directly.

Steps to Reproduce Problem

The problem can be reproduced by modifying the CTRLTEST sample:

  1. Open AppStudio on CTRLTEST project.

  2. Open IDD_CUSTOM_LIST dialog.

  3. Select the list box.

  4. In the ListBox Properties Dialog go to Styles.

  5. Select MultiColumn and OwnerDraw as Variable Styles.

  6. Build and Execute the sample.

  7. The GP fault occurs when you choose the menu item (Custom\Custom ListBox).

To reproduce the problem using Visual C++ version 4.0, use the following steps:

  1. Open CTRLTEST.RC in a text editor. (NotePad will suffice.)

  2. Add "| LBS_MULTICOLUMN" to the list of styles for the LISTBOX object of the IDD_CUSTOM_LIST DIALOG object.

  3. Save and close CTRLTEST.RC.

  4. Open the CTRLTEST project in Developer Studio.

  5. Build and Execute the sample.

  6. The Application Error occurs when you choose the Custom ListBox option from the Custom menu.


Additional reference words: GPF 1.00 1.50 1.51 1.52 2.10 2.00 2.50 2.51
2.52 3.00 3.10 4.00
KBCategory: kbtool kbprb
KBSubcategory: AppStudioIss
Keywords : AppStudioIss kbprb kbtool
Technology : kbMfc
Version : 1.00 1.50 1.51 1.52 | 1.00 2.00
Platform : NT WINDOWS


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: July 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.