Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a event to an object
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Miscellaneous
Thread ID:
01315742
Message ID:
01315774
Views:
15
Does this object belong to something, say, screen or form? If yes, then you can access it through the parent object.

>>>Hi! There
>>>
>>>is there any way to add an event, or a listener, or a hook to an already created object?
>>>
>>>to be more specific, let's say you have this custom class
>>>
>>>
>>>define class myClass as custom
>>>     nTest = 0
>>>enddefine
>>>
>>>
>>>i don't have access to the source code of the class and i need a program fires when the ntest changes or is accessed.
>>>
>>>I know there is this access and assign stuff, but once again, don't have access to code.
>>>
>>>so, is there any way to add this to the object alredy created?
>>
>>Selim,
>>
>>You can use BINDEVENTS with properties too, in your form (or whatever) use
>>Bindevent(thisform.myClassInstance, 'nTest', thisform, 'myHandler')
>>
>>This will only work for changes, not accesses thou
>>
>>[Update]
>>
>>Can't you subclass myClass and add the access and assign?
>>
>>[Update 2] Ooops, that is what Hilmar said, sorry
>BindEvents won't work on VFP6, is it?
>
>and by subclassing? the object is already in memory and named oMyObject
>how can i subclass and still the object be oMyobject?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform