Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP COM Design Problem
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01214563
Message ID:
01214617
Views:
9
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform