BUG: Error if Listview Cleared Using the AfterLabeledit Event

Last reviewed: October 16, 1996
Article ID: Q141681
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 32-bit only, for Windows version 4.0

SYMPTOMS

When you edit a ListItem object in a ListView control in the 32-bit edition of Visual Basic for Windows, the following Windows Common Controls message appears and your Visual Basic program ends due to an application error:

   This item's control has been deleted.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start the 32-bit version of Visual Basic 4.0 or if it is already running, on the File menu, click New Project.

  2. Add a ListView control to the Form1 form.

  3. Add the following code to the Form1 code window:

          Private Sub Form_Load()
    
             Call ListView1.ListItems.Add(, , "Edit this Line")
          End Sub
    
          Private Sub ListView1_AfterLabelEdit(Cancel As Integer, _
                                                NewString As String)
             ListView1.ListItems.Clear
          End Sub
    
          Private Sub ListView1_Click()
             'Without this line in this event, you have to triple-click
             'in order to edit the listitem
             ListView1.StartLabelEdit
          End sub
    
    

  4. Press the F5 key to start the program. Click the ListItem in the ListView control.

  5. Delete the ListItem text by pressing the DEL key, and then press the ENTER key. The Windows Common Controls dialog box with the message, "This item's control has been deleted." displays. Click the OK button. An application error occurs with one of the following messages and Visual Basic stops with an application error:

          Windows NT 3.51-An application error has occurred and an application
    
                          error log is being generated. VB32.exe. Exception:
                          Access violation (0xc0000005), Address: 0x77d86066)
    
          Windows 95-VB32 caused an invalid page fault in module COMCTL32.DLL
                     at 0137:bff0110b.
    


Additional reference words: 4.00 vb4win vb432 ListView ListItem errmsg
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsStd PrgOther


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: October 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.