2014-09-27 56 views
0

我想MessageBox的捲曲結果:獲得捲曲導致MFC C++

CURL *curl; 
CURLcode res; 
curl = curl_easy_init(); 
if (curl) { 
    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); 
    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); 
    res = curl_easy_perform(curl); 
    if (res != CURLE_OK) 
     fprintf(stderr, "curl_easy_perform() failed: %s\n", 
     curl_easy_strerror(res)); 
    curl_easy_cleanup(curl); 
} 
MessageBox(res, _T("Title"), MB_ICONASTERISK | MB_OK); 

我怎樣才能的MessageBox的資源價值?

+0

什麼是錯誤?什麼是'CURLcode'類? – Ajay 2014-09-27 08:21:01

+0

我得到一些中國奇怪的字符,而不是結果 – Clax 2014-09-27 17:41:52

回答

0
 CString str(readBuffer.c_str()); 

    statictext.SetWindowTextW(LPCTSTR(str)); 
    MessageBox(LPCTSTR(str), _T("Title"), MB_ICONASTERISK | MB_OK); 
    curl_easy_cleanup(curl); 

終於找到了辦法!