Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PARENT is not an Object
Message
From
11/01/1999 12:02:23
 
 
To
11/01/1999 11:24:34
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00174673
Message ID:
00174688
Views:
18
>I am new to VFP OO coding & am having problems with one object modifying the properties of its parent.
>
>ex.
>oOne is created from a nonvisual class (OBJECT1), it creates an instance of OBJECT2 (oTWO), another class defined in the same prg file.
>
>Part of oTWO's job is to update a counter in oOne, so I include the following code in one of OJECT2's methods:
>
>THIS.PARENT.counter = THIS.PARENT.counter + 1
>
>When it executes I get the error message that THIS.PARENT is not an object & the debugger confirms this, parent = (none)
>
>I don't understand this at all. How could an oject created by another NOT have a parent value filled in?

'Parent' is reference to container object (if any exists) for the control, i.e. in your situation you may use it only if the second object is created as part of the first:
oMyobject1.Addobject("oMyobject2","MyClass2")
and later This.Parent issued from some method/event of oMyobject2 will refer to oMyobject1
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform