
04.04.2010, 14:52
|
|
Познавший АНТИЧАТ
Регистрация: 24.06.2008
Сообщений: 1,996
С нами:
9410786
Репутация:
2731
|
|
Фух, решил проблему. Спасибо, M_script_.
Вот рабочий метод Execute():
PHP код:
void __fastcall TMyThread::Execute()
{
EnterCriticalSection(&Form1->CS);
HINSTANCE libcurl = NULL;
if((libcurl = LoadLibrary( "libcurl.dll" )) == NULL)
MessageBox(NULL, "û", MB_OK, 0);
CURL*(__stdcall *curl_easy_init)();
CURLcode(__stdcall *curl_easy_setopt )(CURL *curl, CURLoption option, ...);
CURLcode (__stdcall *curl_easy_perform )(CURL *curl);
void (__stdcall *curl_easy_cleanup )(CURL *curl);
curl_easy_init=(CURL*(__stdcall*)())GetProcAddress(libcurl, "curl_easy_init" );
curl_easy_setopt=(CURLcode(__stdcall *)(CURL *curl, CURLoption option, ...))
GetProcAddress(libcurl, "curl_easy_setopt");
curl_easy_perform=(CURLcode(__stdcall *)(CURL *curl))GetProcAddress(libcurl, "curl_easy_perform" );
curl_easy_cleanup=(void (__stdcall *)(CURL *curl))GetProcAddress(libcurl, "curl_easy_cleanup" );
CURL *curl;
curl = curl_easy_init();
LeaveCriticalSection(&Form1->CS);
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &table);
curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
|
|
|