Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Methods in Classes for Objects Added at Runtime
Message
De
23/02/2006 19:31:11
 
 
À
23/02/2006 18:38:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01096949
Message ID:
01098745
Vues:
16
In your reply to me, you provided the following code fragment:

>
CLEAR

x=CREATEOBJECT("someClass")
? x.oInner && you can access to the protected object !
x.show(1)

DEFINE CLASS someClass AS Form 

	ADD OBJECT PROTECTED oInner AS TextBox

	PROCEDURE init
		* bind doens't work within the class !
		BINDEVENT(this.oInner,"Click",m.thisform,"delegate")

	PROCEDURE delegate
		DEBUGOUT PROGRAM()

	PROCEDURE error
		lparameters a,b,c,d
		? MESSAGE()
ENDDEFINE
>

Fabio, I don't think this will work. I didn't copy and paste your code to test it, but I think you're looking at the genesis of my problem in the first place: BINDEVENT won't be able to see oInner since it's PROTECTED. BINDEVENT seems to require that all participants be public.

Now, the visibility issue (i.e. the exposure of oInner) is a separate issue, and that one concerns me. I'll spend a little time tonight exploring that one.

Eric
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform