Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Microsoft variables declarations and QM translation
#2
When calling functions through IDispatch, VARIANT is used as an intermediate type for parameters and the return value. In this case it is of type VT_NULL sometimes, and QM then cannot convert to string (although should).

Macro Macro319
Code:
Copy      Help
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
,VARIANT v=objProcess.AdapterType
,;out v.vt
,sel(v.vt) case VT_BSTR _s=v; case VT_NULL _s="<null>"; case else end "error"
,out _s
,;_s=objProcess.ProductName
,;out _s


Messages In This Thread
RE: Microsoft variables declarations and QM translation - by Gintaras - 02-04-2019, 05:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)