Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AddObject in COM dll
Message
De
28/08/2004 11:18:54
 
 
À
28/08/2004 06:29:47
Darren Woodford
Woodford Computer Systems Ltd
Rhyl, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00937278
Message ID:
00937296
Vues:
6
Hi,

>>
From searching google groups this seems to be because there is not an interface defined for the child object. However I thought as the COM .DLL created by VFP uses IDispatch (is this the same as late-binding?) rather than the TLB this wouldn't matter.
>>

The interface of a COM object is defined at compile time. Early/Late binding only determines when you access that interface. You can try something like:
DEFINE CLASS TopLevel AS CUSTOM OLEPUBLIC

  FUNCTION AddRef()
    LPARAMETERS cName,cClass
    THIS.ADDOBJECT(cName,cClass)
    RETURN EVALUATE("this."+cName)
  ENDFUNC

ENDDEFINE

DEFINE CLASS ChildClass AS CUSTOM
  Test = "Hello"
ENDDEFINE
then:
loCOMServer = CreateObject("ComServer.TopLevel")
oObj = loCOMServer.AddRef("oFred","ChildClass")
? oObj.Test
HTH,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform