Information générale
Catégorie:
COM/DCOM et OLE Automation
Hi Larry,
Using the bindevents method of VFPCOM, how do you reference a property on the ActiveX/COM object from within the VFP event sink object procedures?
If I have this as a procedure in the class def. of the sink object:
PROCEDURE INIT
THIS.LEFT = 100
ENDPROC
Referencing this.left doesnt reference the ActiveX object, because This is the sink object.
I know I can add a property in the class def. of the sink object and after binding the ActiveX to the sink object, store an object reference to the ActiveX in that custom property and use the following init event:
PROCEDURE INIT
THIS.oBound.LEFT=100
ENDPROC
*oBound being the custom property added to the class def.
Is there another way? if this makes sense...
TIA,
Jon
>You can do much the same thing using VFPCOM. Two methods of this object are ExportEvents and BindEvents.
>
>ExportEvents allows you to specify an object and have all of its events exported to a file in the form of a custom class definition, one procedure per event.
>
>You can create an instane of this new object and an instance of the ActiveX control and use the BindEvents method of the VFPCOM object to link them. Whenever an event fires in the ActiveX control, the corresponding event in your custom class will fire, running your code.
>
>This technique works well when you don't want need a container to hold the ActiveX object (e.g. Word, Excel).
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