Open ghuysmans opened 2 years ago
This is implemented in winax/src/disp.cpp.
Minimal example:
var winax = require("winax");
var conn = new winax.Object("ADODB.Connection");
conn.connectionString = "dsn=whatever";
console.log(typeof(conn.connectionString));
var wmi = new winax.Object("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2", {getobject: true});
var q = wmi.execQuery("SELECT * FROM Win32_IP4RouteTable");
console.log(typeof(q._NewEnum.Next().interfaceIndex.__value));
ADSI has wrapped properties, too.
getobject
returns a dispatch "function":
console.log(conn); //null
console.log(wmi); //Dispatch
Properties aren't always wrapped. When does it happen? Field values in an ADODB recordset aren't wrapped, but WMI data are.