How to compare BSTR against a string in c/c++?

前端 未结 4 1556
名媛妹妹
名媛妹妹 2021-01-11 16:32
wprintf(L\"Selecting Audio Input Device: %s\\n\", 
                            varName.bstrVal);

if(0 == strcmp(varName.bstrVal, \"IP Camera [JPEG/MJPEG]\"))...
         


        
4条回答
  •  醉梦人生
    2021-01-11 17:19

    My solution:

    static const std::wstring IPCamera = L"IP Camera [JPEG/MJPEG]";
    if (varName.bstrVal == IPCamera {
      //...
    

提交回复
热议问题