Microsoft KB Archive/300055

= FIX: Init Event Shows Twice in Event Tracking on Objects Created with AddObject =

Article ID: 300055

Article Last Modified on 10/16/2002

-

APPLIES TO


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

-



This article was previously published under Q300055



SYMPTOMS
If you use AddObject in the Init event of a class that adds a container, the Init event for objects in the container appears twice in the event log.



STATUS
This problem was corrected in Visual FoxPro version 7.0 for Windows.



Steps to Reproduce Behavior
  In Visual FoxPro (VFP) 5.0 or 6.0, paste the following code in a new program: *!* Q300055 FIX: Init Event Shows Twice In Event Tracking On Objects Created With AddObject SET EVENTLIST TO INIT, DESTROY SET EVENTTRACKING TO EventProb.LOG SET EVENTTRACKING ON

ox = CREATEOBJECT('EventProb') ox = NULL

SET EVENTTRACKING OFF SET EVENTTRACKING TO MODIFY FILE EventProb.LOG NOWAIT

DEFINE CLASS EventProb AS FORM PROCEDURE INIT THIS.ADDOBJECT('cntProb', 'ProbContainer') ENDDEFINE

DEFINE CLASS ProbContainer AS CONTAINER ADD OBJECT txtDemo AS TEXTBOX ENDDEFINE  Save and run the code (the name is unimportant). The event log appears on the screen. Note that the Init event for the text box appears in the log twice, on lines 2 and 3.

Keywords: kbbug kbfix kbcodesnippet kbvfp700fix KB300055

-

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

© Microsoft Corporation. All rights reserved.