Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Converting strings to string_t

$
0
0
I'm a new coder trying to integrate Casablanca into an app in order to retrieve values from a page and would like to use a dynamic querystring. I can't quite figure out how to overcome this error at compile time:

Error 8 error C2440: 'initializing' : cannot convert from 'const std::string' to 'std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>'

The code I'm working with:

const string_t seedtoupload = localseed;
http_client client(U("http://somesite.com/"));
uri_builder builder(U("/appname/"));
builder.append_query(U("s"), seedtoupload);

localseed is a std::string, and I've tried various conversion gymnastics (converting it to a char array, c string, etc), but I always get a convert failure when I try to cast it into the string_t that the builder requires.

Suggestions?

Viewing all articles
Browse latest Browse all 4845

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>