How do I get XML format WMI object text in unmanaged C++ RRS feed

  • Question

  • I want to know how do I get WMI object text in XML format in unmanaged C++.

    I want to modify the memory size of the Hyper-V vm, so I use the Msvm_VirtualSystemManagementService's ModifyVirtualSystemResources method.  This method requires me pass the
    Msvm_MemorySettingData instance data in the XML format.  This can be easily done in C# and managed C++ with GetText(TextFormat.WmiDtd20).  However, how do I get the info in XML format in unmangaed C++?  When I called IWbemClassObject's GetObjectText(), it only returns the object text in MOF format.  How do I convert the object text from MOF format to XML format in unmanaged C++?  I assume I can write my own XML parser to create the object text in XML format, or I can create a C# or managed C++ DLL just to get the object text in XML format, but are there easier way than that?  Do I miss any unmanaged C++ functions that can do the similar trick as C# or managed C++?

    Tuesday, May 13, 2008 9:09 PM