I'm writing a response to a WCF call in unmanaged code. The problem is that I have an integer which I want to convert into WS_STRING
and respond back.
The std::towstring
converts only to a wstring and doesn't convert into WS_STRING. How can I make that happen ?
I saw there was an older thread that had a similar question, but it seemed unanswered.
int i = 100;
responseWsString = std::to_wstring(i);
//Throws compiler error : No operator '=' matches operands of type WS_STRING = std::wstring
This is expected as the types are differnt. The other thread mentions that const_cast<>
is not a good approach. Then how do I solve this simple problem to convert int into WS_STRING ?
Here is a link to the previous: Convert wstring to WS_STRING