Get CURL result as a string

Hello
I am getting the content of a web page with curlib, into a variable called res of CURLcode type. How can I convert that variable into a string so I can use it inside of an EDIT, STATIC or MessageBox control (of Win32 API)?

This is my code
1
2
3
4
5
6
7
8
9
10
CURL *curl;
CURLcode res;

curl = curl_easy_init();
if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, "http://www.url.com");
    res = curl_easy_perform(curl);
    MessageBox(NULL, res/* Converted to string */, "Code", MB_OK|MB_ICONERROR);
    curl_easy_cleanup(curl);
}


Thanks
I think you can just call curl_easy_strerror() so something like this:

 
MessageBox(0,curl_easy_strerror(res),"Code",MB_OK|MB_ICONERROR);

Topic archived. No new replies allowed.