/// It must be in stdafx. add // # import "msxml3.dll" // import the Type Library # define MSXML msxml2 // start dxdiag.exe and use it to generate an XML file // use javasdxdiag.exe /?] To view usage // startupinfo Si = {sizeof (SI), 0}; process_information Pi = {0}; tchar szcmdline [max_path] = _ T ("dxdiag.exe/WHQL: off/X dxdiag_output.xml "); // replace it with [/X], that is, if (CreateProcess (null, sz1_line, null, null, true, null, & Si, & PI) {waitforsingleobject (Pi. hprocess, infinite); // wait until dxdiag.exe finishes executing closehandle (Pi. hprocess); closehandle (Pi. hthread);} // load the XML file // MSXML: ixmldomdocumentptr m _ Pdoc; If (! M_pdoc-> load (_ bstr_t) "dxdiag_output.xml") {afxmessagebox ("loading dxdiag_output.xml failed"); Return-1 ;}/// parse the XML file, read the BIOS configuration in the same way. // MSXML: ixmldomelementptr pdocelement = m_pdoc-> getdocumentelement (); If (pdocelement) {MSXML :: ixmldomelementptr pelement = pdocelement-> selectsinglenode (_ bstr_t) "systeminformation/BIOS"); If (pelement) {afxmessagebox (lpcstr) (pelement-> gettext ());}}