Microsoft KB Archive/317489

= FIX: Exclude Property Is Not Refreshed When File Is Excluded or Included in the User Interface =

Article ID: 317489

Article Last Modified on 4/10/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q317489



SYMPTOMS
The Exclude property of the File object is not refreshed when a file is either included or excluded with the user interface of Visual FoxPro 7.0. If you programmatically include or exclude the file, this property reflects the current status of the file.



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 Microsoft Visual FoxPro for Windows 7.0.

This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to Reproduce Behavior
  Paste the following code in a program (.prg) file named Test.prg, and then run the program from the Command window: CLOSE ALL IF !FILE(&quot;Prog1.PRG&quot;) STRTOFILE(&quot;X=1&quot;,&quot;Prog1.prg&quot;) STRTOFILE(&quot;X=1&quot;,&quot;Prog2.prg&quot;) ENDIF MODI PROJ Test NOWAIT _VFP.ACTIVEPROJECT.FILES.ADD(ADDBS(JUSTPATH(SYS(16))) + &quot;Prog1.prg&quot;) _VFP.ACTIVEPROJECT.FILES.ADD(ADDBS(JUSTPATH(SYS(16))) + &quot;Prog2.prg&quot;) MOVE WINDOW &quot;Project Manager - Test&quot; to 4,40 _SCREEN.ADDOBJECT(&quot;cmd1&quot;,&quot;MyButton1&quot;) _SCREEN.ADDOBJECT(&quot;cmd2&quot;,&quot;MyButton2&quot;) _SCREEN.cmd2.Left = 125 _SCREEN.cmd1.VISIBLE = .T. _SCREEN.cmd2.VISIBLE = .T.

@ 2,0 SAY &quot;When done, hit CTRL+T to clean-up&quot; ON KEY LABEL CTRL+T CleanUp

DEFINE CLASS MyButton1 AS COMMANDBUTTON CAPTION = &quot;Is Prog2 Excluded?&quot; WIDTH = 120 HEIGHT = 25

PROCEDURE CLICK _VFP.ACTIVEPROJECT.REFRESH MESSAGEBOX(TRANS(_VFP.ACTIVEPROJECT.FILES(2).EXCLUDE)) ENDPROC ENDDEFINE

DEFINE CLASS MyButton2 AS COMMANDBUTTON CAPTION = &quot;Exclude/Include Prog2 Programmatically&quot; WIDTH = 225 HEIGHT = 25

PROCEDURE CLICK _VFP.ACTIVEPROJECT.Files(2).Exclude = !_VFP.ACTIVEPROJECT.Files(2).Exclude MESSAGEBOX(&quot;Prog2.Exclude = &quot; + TRANS(_VFP.ACTIVEPROJECT.FILES(2).EXCLUDE)) ENDPROC ENDDEFINE

FUNCTION CleanUp ACTIVATE SCREEN CLEAR ON KEY LABEL CTRL+T _SCREEN.REMOVEOBJECT(&quot;cmd1&quot;) _SCREEN.REMOVEOBJECT(&quot;cmd2&quot;) RELEASE ALL CLEAR ALL CLOSE ALL  Use the Project menu to exclude Prog2.prg from the project. On the desktop, click Is Prog2 Excluded?. A value of False appears in a message box even though the file is excluded. Use the Project menu to include Prog2.prg. On the desktop, click Is Prog2 Excluded?. A value of False appears in a message box. Click Exclude/Include Prog2 Programmatically twice to switch the property of the file object between included and excluded. Note that the correct value appears in the message box.</li> Press CTRL+T to end the program.</li></ol>

Keywords: kbbug kbfix kbprojmanager kbvfp700sp1fix kbcodesnippet KB317489

-

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

© Microsoft Corporation. All rights reserved.