title: How to achieve linking of wmi classes using c++?
body: <p>I have a sample code as below</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Management;
  using System.Text;
  
  namespace WMIIRQ
  {
      class Program
      {
          static void Main(string[] args)
          {
              foreach(ManagementObject Memory in new ManagementObjectSearcher(
                  "select * from Win32_DeviceMemoryAddress").Get())
              {
  
                  Console.WriteLine("Address=" + Memory["Name"]);
                  // associate Memory addresses  with Pnp Devices
                  foreach(ManagementObject Pnp in new ManagementObjectSearcher(
                      "ASSOCIATORS OF {Win32_DeviceMemoryAddress.StartingAddress='" + Memory["StartingAddress"] + "'} WHERE RESULTCLASS  = Win32_PnPEntity").Get())
                  {
                      Console.WriteLine("  Pnp Device =" + Pnp["Caption"]);
  
                      // associate Pnp Devices with IRQ
                      foreach(ManagementObject IRQ in new ManagementObjectSearcher(
                          "ASSOCIATORS OF {Win32_PnPEntity.DeviceID='" + Pnp["PNPDeviceID"] + "'} WHERE RESULTCLASS  = Win32_IRQResource").Get())
                      {
                          Console.WriteLine("    IRQ=" + IRQ["Name"]);
                      }
                  }
  
              }
              Console.ReadLine();
          }
      }
  }
  </code></pre>
  
  <p>I am not familiar with c#, i got this code from some link, I need some methods in c++ so that i can do the exact operation as above mentioned in the code. I searched a lot but i couldn't exactly what i needed. Could someone suggest me the method to get it. Thanks in Advance.</p>