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

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -