I was inspecting some hardware properties and wrote the following
// Connect to WMI Var locator As OLEObject = New OLEObject("WbemScripting.SWbemlocator", True) Var wmiServiceParams() As Variant // Set the WMI local params wmiServiceParams.Add Nil // Param 0 is ignored wmiServiceParams.Add "." wmiServiceParams.Add "root\cimv2" Var computerBoard As OLEObject = OLEObject(locator.Invoke("ConnectServer", wmiServiceParams)).InstancesOf("Win32_baseboard").ItemIndex(0) MessageBox "Manufacturer: "+computerBoard.Manufacturer MessageBox "Model: "+computerBoard.Model // This line raises a null access at my Dell, the work around is computerBoard.Value("Model") computerBoard = Nil locator = Nil Exception err MessageBox err.message
As you see, besides MS docs saying that “Model” should exist, seems that sometimes it may not.
I’m curious to list true ones.
So the question is, how do I, possessing the computerBoard OLEObject above, can build an Enumerator from it, and list its member names in Xojo?