Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP COM Design Problem
Message
De
11/04/2007 15:07:17
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
À
11/04/2007 14:50:01
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01214563
Message ID:
01214630
Vues:
19
Boris the only PITA about this is that you need to put that on every single method, why do you think microsoft come up with code access security.

>>The problem with this approach is that the parameter name would appear in
>>the object browser.
>The parameter name will appear, but who will know the value you pass there?
>Unfortunately I agree with Alexandre, you can't pass parameters to Init event of the COM object.
>But you could do something like that:
>
>DEFINE CLASS MainClass AS ... OLEPUBLIC
>    oChildClass = NULL
>
>   PROCEDURE CreateChildClass()
>         LOCAL loChild AS MyChildClass
>         loChild = CREATEOBJECT([MyChildClass])
>         loChild.UniqueString = [IWantToPlayWithThis]
>         this.oChildClass = loChild
>   ENDPROC
>   .......
>ENDDEFINE
>
>
>DEFINE CLASS MyChildClass AS .... OLEPUBLIC
>    UniqueString = []
>
>    PROCEDURE AnyMethodOrEventOfThisClass
>         IF NOT this.UniqueString == [IWantToPlayWithThis]
>            this.Release()
>            RETURN NULL
>         ENDIF
>         ....
>    ENDPROC
>ENDDEFINE
>
>(not tested)
Alexandre Palma
Senior Application Architect
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform