Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is AddProperty() allowed in COM implementation
Message
De
23/08/2003 08:06:57
 
 
À
22/08/2003 12:23:15
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00822651
Message ID:
00822856
Vues:
21
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:
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform