>>I believe there is no different adding an object at the begining of the define or the INIT.
>>
>>
>
>Actually there is.
>The example I gave you works.
>I tried both, e.g.
define class mytestclass as form olepublic
>
> add object mycustom as custom ;
> with ccustom = "Custom Property"
>
> procedure init
> this.addobject("mycustom2","custom")
> endproc
>
> procedure getmycustom2name()
> return this.mycustom2.name
> endproc
>enddef
>
>** once the DLL is built, try this:
>
>oMy = createobject("mydll.mytestclass")
>? oMy.mycustom.name
>? oMy.mycustom.cCustom
>? oMy.mycustom2.name
>? oMy.getmycustom2name()
>
>>THe question here is why the new created object is hidden somewhat and I think it got to do with the TLB file along with the DLL.
>>
>>Thanks
>
>...Although I still can't tell you why the
this.AddObject()
doesn't work. :)
it's pretty obvious, actually; you're altering the interface at runtime, a definite no-no for a COM object; in order to detect it, you'd have to force the client to requery the IUnknown interface to get a new IDispatch interface which ends up with multiple interfaces having the same CLSID...that what collections or public member arrays of VT_VARIANT are for...