Click or drag to resize

HostFunctionsnewObj Method (Object, Object)

Creates a host object of the specified type. This version is invoked if the specified type cannot be used as a type argument.

Namespace:  Microsoft.ClearScript
Assembly:  ClearScript.Core (in ClearScript.Core.dll) Version: 7.2.5
Syntax
public Object newObj(
	Object type,
	params Object[] args
)

Parameters

type
Type: SystemObject
The type of object to create.
args
Type: SystemObject
Optional constructor arguments.

Return Value

Type: Object
A new host object of the specified type.
Remarks

This function is provided for script languages that do not support external instantiation. It is overloaded with newObjT(Object) and selected at runtime if type cannot be used as a type argument. Note that this applies to some host types that support instantiation, such as certain COM/ActiveX types.

For information about the mapping between host members and script-callable properties and methods, see AddHostObject.

See Also