Composite objects AddObject
AddObject method

Adds an object to the composite.


variable = object.AddObject( name, obj [, flags])


name - Reference name for the added object. This name can be used to refer the object further through VaryDisp's members and through the VaryDispCtx members. 

obj - Object to add

flags - Optional. If omitted the VaryDisp will automatically select the most appropriate way to add the object. For example if the object is a ScriptManager2 or ScriptAggregate the script in them will be actually exposed (not the object itself). The flags that can be specified are:
How to treat the object - one of the:
&H0000 - automatic (default)
&H0001 - As COM object
&H0002 - As ScriptManager2, The script's functions/subs will be exposed
&H0003 - As ScriptAggregate, The script's functions/subs will be exposed
Members access technique:
&H0100 - By name, The members will be called always by name (slow but safe)
&H0000 - By DISPID, The DISPID of each member exposed will be remembered and used in further calls (faster but safe for ordinary COM objects only)
Pass the context to object: 
&H0200 - Pass the context, If the flag is specified the context will be passed.
More comments:
In automatic mode the most appropriate flags are internally set. For example if the added object is a ScriptManager2 or ScriptAggregate the script is exposed, methods are accessed by name and the context is passed to the script. If the object is another COM object members are accessed by DISPID, and context is not passed by default. Therefore you will need to specify flags only if this behavior is not what you need.

returned value: Reference ID of the object added. Can be used for further references to the object.





Applies to: VaryDisp object

newObjects Copyright 2001-2006 newObjects [ ]