convert a STRING from LPCWSTR and vice verca c++ -
i want compare lpcwstr value ensure they're equal. , can't figure out how compare it. create string value , tried various conversions nothing worked. be:
request->id // lpcwstr value string str = "value" // string value want compare if (request->id != str) { //something }
enable mfc/atl , use cstring object:
if (cstring(request->id) != str)
although it's not clear me type string either. use cstring both:
string str = "value" // string value want compare if (cstring(request->id) != str)
or use literal directly:
if (cstring(request->id) != "value")
Comments
Post a Comment