Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How is EventHandler() different from BindEvents?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00622808
Message ID:
00623107
Vues:
22
>>>>How is the new VFP7 eventhandler() function different from BindEvents
>>>>in VFPCOM? Eventhandler looks like it does the exact same thing.
>>>>Is something better about it?
>>>
>>>It functions the same. The difference is that you can use Eventhandler() only for classes which were defined programmatically, while VFPCOM.Bindevents() works with any class whether it was created programmatically or visually. It just has to have the method name corresponding to the event name.
>>
>>I've never been able to make bindevents work with a visually created
>>control.
>>
>>Assuming I did the exportevents and created a progressbar on a form, should
>>something like this work?
>>
>>
>>x = createobject("VFPCOM.COMUtil")
>>myPB = createobject("IProgressBarEvents")
>>x.BindEvents(thisform.pb, myPB)
>>
>>
>>I get an error saying "no such interface supported"
>
>Hi Joe,
>
>If thisform.pb is a property referencing some COM object, and myPB is a VFP object which has myEvent method corresponding to the event in COM object, yes, it should work. What is your COM object?

thisform.pb is a microsoft progress bar v6. Is that not a COM object?

>If you send me your test project along with your COM I can tell you exactly why your sample does not work properly.

If I can't resolve this I may. Thanks!

>When you use VFPCOM, you really need ExportEvents method only to tell you what event names are exposed in COM object and what are the parameters. Then you can add the methods with the same names for any VFP visual class and bind them.

I used exportevents to output the class definition to a file so that
pretty much does all the work for me.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform