String ^ string = _gc_new String
#include <iostream>#include "windows.h"#using <mscorlib.dll> #using <System.Management.dll> #include <WbemIdl.h>#include <mmreg.h>#include <dsound.h>#include "initguid.h"#include <QTimer>#include <set>using namespace std;using namespace System;using namespace System::Management;#define _WIN32_DCOMManagementObjectSearcher *searcher; searcher= new ManagementObjectSearcher(); Query = new Management::ObjectQuery("SELECT Name FROM Win32_SoundDevice WHERE StatusInfo = 3"); ManagementObjectCollection *coll = searcher->Get(); if (coll != NULL) { ui.lineEdit_2->setText("Микрофон подключен к комрьютеру"); }