Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddObject in COM dll
Message
From
28/08/2004 11:18:54
 
 
To
28/08/2004 06:29:47
Darren Woodford
Woodford Computer Systems Ltd
Rhyl, United Kingdom
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00937278
Message ID:
00937296
Views:
7
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
Previous
Reply
Map
View

Click here to load this message in the networking platform