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