Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Eventbinding question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Eventbinding question
Divers
Thread ID:
00782700
Message ID:
00782700
Vues:
56
I'm playing around with event binding inside of VFP 8 and had a quick question about it. BINDEVENT() assumes I have an object reference to an object that will be raising events. What if I don't know (or want to know) the event source? Is their a way to raise/bind to an event that isn't part of an object (eg. for example, call a function instead)? Here's the syntax I'd like to use (but doesn't work):
* Define the event
FUNCTION MyCustomEvent(tuSomeParameter)
ENDFUNC

* Raise the event
lcParameter = "Hello"
RAISEVENT(.NULL., "MyCustomEvent", "Hello")

* Bind a method to the event
BINDEVENT(.NULL., "MyCustomEvent", This, "MyEventHandler")
If there is a way to do this, that'd be great (otherwise I'll stop wasting my time trying to do this <g>). According to the docs, I've got to pass an object reference. I guess I could create a private "Event" object that's in scope for the entire life of the app, and let it handle the events. That just seems, well, weird.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform