Microsoft KB Archive/185085

= FIX: Modal Form and Form with Treeview Causes Memory Error =

Article ID: 185085

Article Last Modified on 3/23/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q185085



SYMPTOMS
Adding nodes to a Treeview control that resides on an inactive page of a pageframe after displaying a modal form, causes Visual FoxPro to generate one of the error messages shown below.

In Windows NT 4.0, Dr. Watson for Windows NT reports the following error:

An application error has occurred and an application log is being generated.

VFP.exe

Exception access violation(0xc00000050), Address:

In Windows 95, the following error appears:

This program caused and illegal operation and will be shutdown.

Pressing the Details button results in one of the messages below:

VFP caused an invalid page fault in module at.

-or-

VFP caused an invalid page fault in module COMCTL32.OCX at.



RESOLUTION
Change the WindowType of the modal form to Normal. However, this allows users to manipulate items that are not on the previously modal form.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
 Create a form called Ztest and add a pageframe to the form. Right-click the pageframe and choose Edit. Place a Microsoft TreeView control on each page and name them OLEControl1 and OLEControl2 respectively. Place a command button on the form change the Caption property to Refresh. In the Click event of the command button add the following code:

* Refresh the first page of the pageframe. THISFORM.pageframe1.page1.OLEControl1.nodes.CLEAR FOR i= 1 TO 5 THISFORM.pageframe1.page1.OLEControl1.nodes.ADD(,,,STR(RAND*100)) THISFORM.pageframe1.page1.OLEControl1.nodes.ADD(,,,STR(RAND*100)) ENDFOR * Refresh the second page of pageframe. THISFORM.pageframe1.page2.OLEControl2.nodes.CLEAR FOR i= 1 TO 5 THISFORM.pageframe1.page2.OLEControl2.nodes.ADD(,,,STR(RAND*100)) THISFORM.pageframe1.page2.OLEControl2.nodes.ADD(,,,STR(RAND*100)) ENDFOR THISFORM.REFRESH

 Add a second command button and change the Caption to "Do Modal Form."

Add the following to the Click event of the command button:

DO FORM modalform

 Create a form called modalform, and change the Windowtype to 1-Modal. Add a command button to the form that has the following code in the Click event:

ThisForm.Release

Change the Caption property of the command button to Exit.</li> Save both forms.</li> Run the form using the following command:

Do Ztest.scx

Press the refresh button, and click the second page of the pageframe. Next, click the first page of the pageframe. Then, press the "Do Modal Form" button to call the modal form. Once the modal form appears, press the Exit button on the modal form. Finally, press the refresh button on Ztest.scx. The error occurs.</li></ol>

Additional query words: crash hang GPF kbvfp600fix

Keywords: kbbug kbfix KB185085

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.