ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
HostFunctions Class
HostFunctions Methods
newObj Method
newObj Method
newObj<T>(Object[]) Method
newObj(IDynamicMetaObjectProvider, Object[]) Method
newObj(Object, Object[]) Method

# HostFunctionsnewObj(Object, Object) Method

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.5.0
Syntax
C#
VB
C++
F#
Copy

    public Object newObj(
    	Object type,
    	params Object[] args
    )

    Public Function newObj (
    	type As Object,
    	ParamArray args As Object()
    ) As Object

    public:
    Object^ newObj(
    	Object^ type,
    	... array<Object^>^ args
    )

    member newObj :
            type : Object *
            args : Object[] -> Object

#### Parameters

type Object
  The type of object to create.
args Object
  Optional constructor arguments.

#### Return Value

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

#### Reference

HostFunctions Class
newObj Overload
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft