Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP COM Design Problem
Message
From
11/04/2007 15:07:17
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01214563
Message ID:
01214630
Views:
18
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
Previous
Reply
Map
View

Click here to load this message in the networking platform