02-04-2019, 05:20 PM
Hi Gintaras, hi all,
using some WMI interfaces, i face a problem in type portage to Qm, thus it seems OK
Example, I search to get network interfaces paramaters.
For instance, following the declatation from Microsoft site:
Win32_NetworkAdapter class
Syntax
If I use this code:
def wbemFlagReturnImmediately 16
def wbemFlagForwardOnly 32
int IFlags = wbemFlagReturnImmediately|wbemFlagForwardOnly
IDispatch objWMIService._getfile("winmgmts:")
IDispatch colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter",@,IFlags)
IDispatch objProcess
foreach objProcess colProcesses
_s=objProcess.AdapterType
out _s <================== Error (RT) in <open ":171: /388">Macro17: 0x80020005, type mismatch.
_s=objProcess.ProductName
out _s <=========================output correct
Microsoft Kernel Debug Network Adapter
TAP-Windows Adapter V9
Intel® Dual Band Wireless-AC 7260
Microsoft Wi-Fi Direct Virtual Adapter
Bluetooth Device (Personal Area Network)
Microsoft Wi-Fi Direct Virtual Adapter
WAN Miniport (SSTP)
WAN Miniport (IKEv2)
WAN Miniport (L2TP)
WAN Miniport (PPTP)
WAN Miniport (PPPOE)
WAN Miniport (IP)
WAN Miniport (IPv6)
WAN Miniport (Network Monitor)
Microsoft Wi-Fi Direct Virtual Adapter
Microsoft Wi-Fi Direct Virtual Adapter
Both should be string as per declaration, but one is giving error, the other is OK.
I'm out of clues, i know you can help this weird behavior
Thanks!
using some WMI interfaces, i face a problem in type portage to Qm, thus it seems OK
Example, I search to get network interfaces paramaters.
For instance, following the declatation from Microsoft site:
Win32_NetworkAdapter class
Syntax
class Win32_NetworkAdapter : CIM_NetworkAdapter
{
string AdapterType;
.......
string ProductName;
.....
}
If I use this code:
def wbemFlagReturnImmediately 16
def wbemFlagForwardOnly 32
int IFlags = wbemFlagReturnImmediately|wbemFlagForwardOnly
IDispatch objWMIService._getfile("winmgmts:")
IDispatch colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter",@,IFlags)
IDispatch objProcess
foreach objProcess colProcesses
_s=objProcess.AdapterType
out _s <================== Error (RT) in <open ":171: /388">Macro17: 0x80020005, type mismatch.
_s=objProcess.ProductName
out _s <=========================output correct
Microsoft Kernel Debug Network Adapter
TAP-Windows Adapter V9
Intel® Dual Band Wireless-AC 7260
Microsoft Wi-Fi Direct Virtual Adapter
Bluetooth Device (Personal Area Network)
Microsoft Wi-Fi Direct Virtual Adapter
WAN Miniport (SSTP)
WAN Miniport (IKEv2)
WAN Miniport (L2TP)
WAN Miniport (PPTP)
WAN Miniport (PPPOE)
WAN Miniport (IP)
WAN Miniport (IPv6)
WAN Miniport (Network Monitor)
Microsoft Wi-Fi Direct Virtual Adapter
Microsoft Wi-Fi Direct Virtual Adapter
Both should be string as per declaration, but one is giving error, the other is OK.
I'm out of clues, i know you can help this weird behavior
Thanks!