Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP COM Design Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01214563
Message ID:
01214617
Vues:
10
>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)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform