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

前端 未结 4 1562
名媛妹妹
名媛妹妹 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:18

    As a richer alternative to the C runtime, you could use the Unicode CompareString or CompareStringEx APIs in Win32. If you don't have charset issues to consider, wcscmp is fine though.

提交回复
热议问题