Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a procedure to an ActiveX control
Message
De
29/06/2000 16:09:08
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00386187
Message ID:
00386709
Vues:
12
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
Fil
Voir

Click here to load this message in the networking platform