Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Custom ActiveX DLL Events
Message
De
18/12/1997 01:50:58
 
 
À
18/12/1997 00:45:30
Jay Shepherd
Construction DataFax, Inc.
Montevallo, Alabama, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00066798
Message ID:
00066834
Vues:
50
>>The whole idea is that you don't need to create an object (which is a class instantiation). You need to create a class. In the class definition you can overwrite the methods of the base control/ActiveXDLL/ActiveX/OCX.
>
>Exactly. That's why I think I'm close. I'm trying to follow the example in help on DEFINE CLASS, and I can't get it to work. I keep getting syntax errors when I try to add an object (not mine, but a real ActiveX control)

This is a quick&dirty code sample of what you can do. Pointers.PointersCtrl.1 is one of my ActiveXs created in VC++. It's inivisible at runtime, etc.
oTemp = CREATEOBJECT('MyContainer')  && Create a Form

*-- This calls the Test method
oTemp.oleObjectExample.Test()
oTemp.oleObjectExample.DeleteAll()

DEFINE CLASS oleClassExample AS OleControl
	OleClass ="POINTERS.PointersCtrl.1"
	*-- This is a new method (the ActiveX doesn't have it)
	PROCEDURE Test
		WAIT WINDOW "I'm the test message on the screen..."
	ENDPROC
	
	*-- This is a redefinition of the original
	*   DeleteAll method.
	FUNCTION DeleteAll
		*-- Call the ancestor's DeleteAll method
		DODEFAULT()
		WAIT WINDOW "Now we are in the DeleteAll method..."
	ENDFUNC
ENDDEFINE

DEFINE CLASS MyContainer AS Form
	ADD OBJECT oleObjectExample AS oleClassExample 
ENDDEFINE
Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform