Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is AddProperty() allowed in COM implementation
Message
De
25/08/2003 09:33:16
 
 
À
23/08/2003 08:06:57
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00822651
Message ID:
00823026
Vues:
36
>Hi,
>
>>Is the AddProperty() method allowed in COM implementation?
>
>It's allowed - but since the property is added at runtime it will not be available via the COM interface (which is defined at compile time). For example with the following DLL:

I know it will not crash the program, but in the implementation I need, it has to be 'added' to the session class without instantiating a local instance of the object.

I'm using VFP7 (can't use collection), and I changed my implementation to use an array and it works without
having to use a local instance of the object.

Thank you for the feedback.

>
>DEFINE CLASS Viv AS SESSION OLEPUBLIC
>  PROCEDURE ADDP(NAME,CLASS)
>    o = CREATEOBJECT(NAME)
>    THIS.ADDPROPERTY(NAME,o)
>  ENDPROC
>  PROCEDURE ReturnValue(x)
>    RETURN EVALUATE(x)
>  ENDPROC
>ENDDEFINE
>
>DEFINE CLASS VivTest AS CURSOR
>  ss = "Hello, world"
>ENDDEFINE
>
>
>then
>
>lO = CreateObject("whatever.whatever")
>lO.AddP("VivTest")
>? lO.ReturnValue("this.VivText.ss")
>
>
>works showing that the object was created OK but only visible through Properties/Methods exposed in the COM interface...
>
>HTH,
>Viv
ramil
~~ learning to stand still
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform