On March 29, 2005 07:03 pm, you wrote:
> Hi!
>
> I encountered some problems while using cURLpp.
I'll try to help you.
>
> I'm using Windows XP - SP1 & compiled cURLpp 0.5.0-RC5 with MSVS .NET 2003
> (VC++). For the project I'm working on I'm using MSVS .NET 2003 (VC++).
>
> There is a strange behaviour... I do this call in my init routine:
>
> this->m_pRequest->setOpt(new
> cURLpp::Options::WriteFunction(WriterMemoryClass::WriteMemoryCallback));
>
> But the compiler complains telling me:
>
> d:\Src\Uni\Work\SpaSe_Client\Connection.cpp(66): error C2664:
>
> 'cURLpp::OptionTrait<OptionType,option>::OptionTrait(cURLpp::Option<OptionT
>ype>::ParamType)': conversion of parameter 1 from 'size_t (void
> *,size_t,size_t,void *)' to 'cURLpp::Option<OptionType>::ParamType' not
> possilbe with
in <curl/curl.h>:
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
void *outstream);
So, the first argument of your WriteMemoryCallback should be a "char*" not a
"void *".
> [
> OptionType=cURL::curl_write_callback,
> option=CURLOPT_WRITEFUNCTION
> ]
> and
> [
> OptionType=cURL::curl_write_callback
> ]
>
> But if I use this (which doesn't make sense, I used only for testing if it
> works with cURL or if I get the same error):
>
> cURL::curl_easy_setopt((cURL::CURL*)this->m_pRequest,
> cURL::CURLOPT_WRITEFUNCTION, WriterMemoryClass::WriteMemoryCallback);
>
> All is OK. Here no error are reported (from the compiler). Why is this so?
>
> WriterMemoryClass is a class which holds the result of the callback and the
> callback itself (declared as static).
>
> What am I making wrong?
> I would be glad to hear from you soon :-)
>
You heard from me :P
> Kind regards, Nazario Cipriani.
--
Jean-Philippe Barrette-LaPierre
Maintener of cURLpp (http://rrette.com/curlpp)
Received on 2005-03-30