How to compare BSTR against a string in c/c++?
wprintf(L"Selecting Audio Input Device: %s\n", varName.bstrVal); if(0 == strcmp(varName.bstrVal, "IP Camera [JPEG/MJPEG]"))... The above reports : error C2664: 'strcmp' : cannot convert parameter 1 from 'BSTR' to 'const char *' Brian R. Bondy You have to use wcscmp instead: if(0 == wcscmp(varName.bstrVal, L"IP Camera [JPEG/MJPEG]")) { } Here is a description of the BSTR data type , it has a length prefix and a real string part which is just an array of WCHAR characters. It also has 2 NULL terminators. The only thing to look out for is that the BSTR data type can contain embedded NULLs in the