FIX: C0000005 Fatal Error Using GETPEM() in Loop with Debugger (221745)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q221745

SYMPTOMS

Placing the GetPem() function in a loop while tracing the code more than once in the Debugger causes the following error in Visual FoxPro 6.0:
Fatal error: Exception code: C0000005
Note that the error message also contains information regarding the line number of the program running when the error occurred.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the next service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a program called Ztest.prg that contains the following code:
    DO doit
    CLEAR ALL
    DO doit
    
    PROC doit
    	SET EXACT ON
    	oForm = CREATEOBJECT( "Form" )
    	oForm.ADDOBJECT("lbl1", "label")
    	FOR EACH loObject IN oForm.OBJECTS
    		m = AMEMBERS( laMembers, loObject )
    		lcClass = loObject.CLASS
    		FOR j = 1 TO m
    		IF ( ! pemstatus( loObject, laMembers[j], 1 ) )
    		luClassValue = getpem( lcClass, laMembers[j] )
    			ENDIF
    		ENDFOR
    	ENDFOR
    ENDPROC
    					
  2. Close and save the program.
  3. Open the Debugger and open the Ztest.prg file.
  4. In the Debugger, click the Resume toolbar button. The C0000005 error appears.
You can also get this error by simply running the code in the example above. In Visual FoxPro 6.0, if you run the program using either the DO command or by pressing the Run button (!) on the standard toolbar with the program open, the C0000005 error appears. In Visual FoxPro 6.0 Service Pack 3, only the DO command causes the error.

Modification Type:MinorLast Reviewed:12/12/2005
Keywords:kbbug kbfix kbMiscTools kbVS600sp4fix kbVS600sp5fix KB221745 kbAudDeveloper