Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

ppnht

@ppnht
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WMI Win32_DiskDrivePhysicalMedia
    P ppnht

    Hello, it took me a while to figure it out how this class works. Here is a sample in Managed C++:

    ManagementObjectCollection ^c = query("Win32\_DiskDrivePhysicalMedia");
    for each(ManagementObject ^o in c)
    {
    	DeviceInfo ^device = gcnew DeviceInfo();
    	ManagementObject ^media = gcnew ManagementObject(o\["Antecedent"\]->ToString());
    	ManagementObject ^disk = gcnew ManagementObject(o\["Dependent"\]->ToString());
    	Object ^temp = disk\["Manufacturer"\];
    	if(temp) device->manufacturer = temp->ToString();
    	temp = disk\["Model"\];
    	if(temp) device->model = temp->ToString();
    	temp = media\["SerialNumber"\];
    	if(temp) device->serial = temp->ToString();
    	
    	list\_->Add(device);
    }
    

    The class Win32_DiskDrivePhysicalMedia only contains references to the Physical Media and Disk Drive objects. You must, then, instatiate both objects to access their properties individually. Regards, Paulo

    C / C++ / MFC com tutorial learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups