Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Addobject and build as a DLL
Message
From
08/11/2000 22:29:24
 
 
To
08/11/2000 17:43:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00439424
Message ID:
00439527
Views:
18
>>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 && displays "MYCUSTOM"
>? oMy.mycustom.cCustom && displays "Custom Property"
>? oMy.mycustom2.name && error: Unknown name
>? oMy.getmycustom2name() && displays "mycust2"
>
>>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...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform