Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: bryan wetton
  Where is bryan wetton?
 Morphett Vale
 Australia
 bryan wetton
 Tags
Subject: WMI Obj Code
Thread ID: 231660 Message ID: 231660 # Views: 30 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Classes and Objects
Date: Tuesday, June 16, 2009 7:48:41 AM         
   


I found these code snippets some time ago and out of interest put in one of my test programs.

oWMI = Getobject("winmgmts:")
oProcessors = oWMI.InstancesOf("WIN32_Processor")
For Each oProcessor In oProcessors
logging('Processor ID' +oProcessor.processorID)
Next

However it only finds 1 processor and the oWMI object is not visible in the debugger.

loCIMV2 = Getobject("winmgmts://localhost/root/cimv2")
Getobject("winmgmts://localhost/root/cimv2")
loProcesses = loCIMV2.ExecQuery("SELECT * FROM Win32_LogicalMemoryConfiguration")
If loProcesses.Count > 0
For Each objProcess In loProcesses
logging ( "Total Physical Memory, in bytes: " + Transform(objProcess.TotalPhysicalMemory))
logging ("Total Virtual Memory, in bytes: " + Transform(objProcess.TotalVirtualMemory))
logging ( "Available Virtual Memory, in bytes: " + Transform(objProcess.AvailableVirtualMemory))
logging ("Total Page File Space, in bytes: " + Transform(objProcess.TotalPageFileSpace))
Next

this also does not giv an object with the appropriate information

Any clues please anyone? I am using WIN 7 with AMD 64 X2 4600.

-Bryan



COMPLETE THREAD
WMI Obj Code Posted by bryan wetton @ 6/16/2009 7:48:41 AM
RE: WMI Obj Code Posted by Stefan Wuebbe @ 6/16/2009 8:32:59 AM
RE: WMI Obj Code Posted by bryan wetton @ 6/16/2009 1:46:49 PM