Information générale
Catégorie:
COM/DCOM et OLE Automation
>>>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement