You are currently offline, waiting for your internet to reconnect

C0000005 fatal error with invalid property name in Visual FoxPro

This article was previously published under Q221734
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
SYMPTOMS
You receive the following error mesage and Visual FoxPro exits:
Fatal error: Exception code = C0000005
This behavior occurs when attempting to access an invalid property of an object.
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 Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

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

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
MORE INFORMATION

Steps to reproduce the behavior

The following steps require Microsoft Outlook to be installed on the computer that is running Visual FoxPro.
  1. Create a program named Getitems.prg using the following code:
       oTraverse = CREATEOBJECT("traverseoutlook")   oTraverse.BeginTraverse   DEFINE CLASS TraverseOutlook AS CUSTOM      nNestingLevel = 0      oOutLookObject = NULL      olNameSpace = NULL      PROCEDURE INIT         WITH THIS            .oOutLookObject = CREATEOBJECT("Outlook.Application")            .olNameSpace = .oOutLookObject.GetNameSpace("MAPI")         ENDWITH      ENDPROC      PROCEDURE BeginTraverse         LOCAL folder         FOR EACH folder ;               IN THIS.olNameSpace.Folders            THIS.ProcessFolder(folder)         NEXT folder      ENDPROC      PROCEDURE ProcessFolder(subfolder)         * The valid property is THIS.nNestingLevel         THIS.NestingLevel = THIS.NestingLevel + 1         ?REPLICATE(CHR(9),THIS.NestingLevel-1),subfolder.NAME         FOR EACH folder IN subfolder.Folders            THIS.ProcessFolder(folder)         NEXT folder         FOR EACH ITEM IN subfolder.Items            ?REPLICATE(CHR(9),THIS.NestingLevel),ITEM.subject         NEXT ITEM         THIS.NestingLevel = THIS.NestingLevel - 1      ENDPROC   ENDDEFINE						
  2. In the Command window, type the following:
    DO GETITEMS					
  3. Visual FoxPro terminates after displaying the following error message:
    Fatal error: Exception code = C0000005
  4. Replace the ProcessFolder (subfolder) code with the following code:
       THIS.nNestingLevel = THIS.nNestingLevel + 1   ?REPLICATE(CHR(9),THIS.nNestingLevel-1),subfolder.NAME   FOR EACH folder IN subfolder.Folders      THIS.ProcessFolder(folder)   NEXT folder    FOR EACH ITEM IN subfolder.Items      ?REPLICATE(CHR(9),THIS.nNestingLevel),ITEM.subject   NEXT ITEM   THIS.nNestingLevel = THIS.nNestingLevel - 1						
  5. In the Command window, type the following:
          DO GETITEMS					
  6. Note that Visual FoxPro outputs information to the screen as the Outlook folder hierarchy is traversed.
kbDSE
Properties

Article ID: 221734 - Last Review: 01/27/2005 08:34:21 - Revision: 2.0

  • Microsoft Visual FoxPro 6.0 Professional Edition
  • kbautomation kbbug kbfix kboop kbvs600sp1fix kbvs600sp2fix kbvs600sp3fix KB221734
Feedback