FIX: Exception Error When You Click Properties Window After You Edit Grid in Form Designer (315075)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 7.0

This article was previously published under Q315075

SYMPTOMS

When you edit a grid object on a form in the Form Designer, and you then click the Properties window, Visual FoxPro reports the following error message and closes unexpectedly:
Fatal Error: Exception code: C0000005

RESOLUTION

To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a program called "Test" and add the following code to it:
    SET RESOURCE OFF && Take the FoxPro user file out of the picture.
    CLEAR TYPEAHEAD 
    LOCAL aobj[1], xx
    DELETE FILE testxx.sc?
    CREATE FORM testxx NOWAIT
    =ASELOBJ(aobj,1)
    xx = aobj[1]
    xx.autocenter = .t.
    xx.addobject('grid1','grid')
    ACTIVATE WINDOW properties 
    * WDOCKABLE('properties',.f.)  && Behavior occurs whether dockable or not.
    xx.grid1.columncount = 2
    xx.grid1.columns[1].name = 'Col1'
    * Trigger Properties window object dropdown.
    KEYBOARD '{ctrl+pgdn}'
    DOEVENTS 
    xx.grid1.columns[2].name = 'Col2'
    * Trigger Properties window object dropdown
    KEYBOARD '{ctrl+pgdn}'
    DOEVENTS 
    xx.grid1.columncount = 3
    xx.grid1.columns[3].name = 'Col3'
    ACTIVATE WINDOW 'form designer - testxx.scx'
    * Save form via File/Save from menu.
    KEYBOARD '{alt+f}s'
    DOEVENTS 
    MOUSE CLICK AT 200, 100 PIXELS WINDOW 'properties'
    DOEVENTS  
    RETURN 
    					
  2. Save the program file, and then execute the program from the Command window.
The preceding code is an automated example. To create the error by using the user interface, follow these steps:
  1. Create a form called "Temp". Make sure that the Form Designer window is normal size, not maximized.
  2. Place a baseclass Grid on the form.
  3. Select the grid, and then open the Properties sheet.
  4. In the Properties window, change the grid's ColumnCount property to 2.
  5. In the Properties window, select column 1, and then change the Name property to Col1.
  6. In the Properties window, select column 2, and then change the Name property to Col2.
  7. In the Properties window, change the grid's ColumnCount to 3.
  8. In the Properties window, select column 3, and then change the Name property to Col3.
  9. Click the Form Designer window title bar (not the form title bar).
  10. Press ALT+F+S to save the form.
  11. Click the Properties window.

Modification Type:MajorLast Reviewed:2/12/2002
Keywords:kbbug kbCodeSnippet kbContainer kbCtrl kbDSupport KB315075