N
NetworkElf
I've been trying to run a simple query to get the amount of memory on my
machine using WMI. However, I seem to be running into a snag. When I hit the
mem = queryObj("MaxCapacity") line, I get an error of "A first chance
exception of type 'System.Management.ManagementException' occurred in
System.Management.dll."
I only seem to get this on non-string returns. If I remove the reference to
MaxCapacity and just ask it to return the tag, it works fine.
Could someone point out what I'm missing here?
Thank you,
ne.
Dim mem As UInt32 = 0
Try
Dim searcher As New Management.ManagementObjectSearcher("select
* from Win32_physicalmemory")
For Each queryObj As Management.ManagementObject In
searcher.Get()
mem = queryObj("MaxCapacity")
MsgBox(queryObj("tag") & " size: " & Convert.ToString(mem))
Next
Catch ex As Exception
End Try
machine using WMI. However, I seem to be running into a snag. When I hit the
mem = queryObj("MaxCapacity") line, I get an error of "A first chance
exception of type 'System.Management.ManagementException' occurred in
System.Management.dll."
I only seem to get this on non-string returns. If I remove the reference to
MaxCapacity and just ask it to return the tag, it works fine.
Could someone point out what I'm missing here?
Thank you,
ne.
Dim mem As UInt32 = 0
Try
Dim searcher As New Management.ManagementObjectSearcher("select
* from Win32_physicalmemory")
For Each queryObj As Management.ManagementObject In
searcher.Get()
mem = queryObj("MaxCapacity")
MsgBox(queryObj("tag") & " size: " & Convert.ToString(mem))
Next
Catch ex As Exception
End Try