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

ID: Q221745


The information in this article applies to:


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 this to be a bug in the Microsoft products listed at the beginning of this article.

The Visual Studio 6.0 Service Pack 3 readme file erroneously lists this bug as having been fixed. Service Pack 3 did not fix this bug.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a program called Ztest.prg that contains the following code:


  2. 
    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 
  3. Close and save the program.


  4. Open the Debugger and open the Ztest.prg file.


  5. In the Debugger, click the Resume toolbar button.


  6. 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.

Additional query words:


Keywords          : kbMiscTools kbVFp600 kbVS600sp3 kbGrpFox kbDSupport 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 30, 1999