Ты че баклан, дефективный?
-
Автор темы
- #1
Код:
AllocConsole();
AttachConsole(GetCurrentProcessId());
HWND Handle = GetConsoleWindow();
freopen("CON", "w", stdout);
CURL* curl;
CURLcode res;
std::string readBuffer;
curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://google.com");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
MessageBoxA(NULL, curl_easy_strerror(res), "", 0);
}
curl_easy_cleanup(curl);
MessageBoxA(NULL, readBuffer.c_str(), "", 0);
}
return TRUE;