cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Unhandled exception in VC++ 2010 with curl_easy

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 15 Sep 2015 20:38:17 +0200 (CEST)

On Tue, 15 Sep 2015, William Elliott wrote:

> I'm using VC++ 2010 and I'm getting this error:
>
> An unhandled exception of type 'System.AccessViolationException' occurred in
> Fourth.exe Additional information: Attempted to read or write protected
> memory. This is often an indication that other memory is corrupt.

...

> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);

The answer is in http://curl.haxx.se/libcurl/c/CURLOPT_WRITEDATA.html and I
quote:

   If you're using libcurl as a win32 DLL, you MUST use the
   CURLOPT_WRITEFUNCTION if you set this option or you will experience crashes.

Due to how ownership of that FILE pointer is handled.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-09-15