ActiveXObject(name)

new ActiveXObject(name)

Load ActiveX object.
Parameters:
Name Type Description
name string
Example
const xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');

Methods

ActiveX_CreateArray(arr, element_variant_type) → {ActiveXObject}

Creates an `ActiveXObject` that contains an object of type (VT_ARRAY|SOME_TYPE).
Parameters:
Name Type Description
arr Array.<*> An array that contains elements of primitive type.
element_variant_type number A variant type of array elements.
Returns:
ActiveXObject
Example
let filename = 'x:\\file.bin';
let bin_data = [0x01, 0x00, 0x00, 0x02]
let com_bin_data = ActiveXObject.ActiveX_CreateArray(bin_data, 0x11) // VT_UI1

let stm = new ActiveXObject('ADODB.Stream');

stm.Open();
stm.Type = 1; //adTypeBinary
stm.Write(com_bin_data);
stm.SaveToFile(filename, 2);
stm.Close();

ActiveX_Get(prop_name) → {*}

Emulates COM's weird behaviour of property accessors.
Parameters:
Name Type Description
prop_name number | string Name of the property or it's numeric index
Returns:
*
Example
some_activex.ActiveX_Get('property_name', 'additional_info').DoSmth();
// in COM:
// some_activex.Item('property_name', 'additional_info').DoSmth();

ActiveX_Set(prop_name)

Emulates COM's weird behaviour of property accessors.
Parameters:
Name Type Description
prop_name number | string Name of the property or it's numeric index
Example
some_activex.ActiveX_Set('property_name', 'new_value', 'additional_info');
// in COM:
// some_activex.Item('property_name', 'additional_info') = "new_value";