newObjects-logo.gif (1024 bytes) ScriptManager2 reference
LPCTSTR szItemName, // name of the item being added
IDispatch* pDispItem // pointer to the IDispatch interface of the item

Adds an interface pointer  to the namespaces collection

Returns 1 based index of the item in the collection or 0 if failed



This method can be used in any state of the script. In all cases method adds an object to the collection used for script namespaces. When the script is not running (not yet loaded or loaded but not started) this is the only action performed by the member. When the script starts (By calling the Run method) all available objects in the collection are passed to the script engine as namespaces. In running (and connected) state Add method not only adds objects to the collection but adds them to the running script namespaces too. Thus you can add some of the namespaces in later time when they are needed - not only before strating the script.

See also:

Script Manager2 Run method

newObjects Copyright newObjects 2001-2005