RE: CURL minor Win32 fixes
Date: Wed, 8 Jan 2003 16:53:36 +0100
On Fri, 3 Jan 2003, matthew b wrote:
> 3. On Windows, you can't pass a FILE * across DLL boundaries as noted
> elsewhere. Unfortunately, this seems to be the ony way you can change
> CURLOPT_STDERR. Is there another way? If not, a new new option passing a
> filenames (then open the file "a+") would be cool, or better make sure
> everything goes through CURLOPT_DEBUGFUNCTION (not quite everything does).
Hum, i'm not shure about this, but AFAIK it's absolutely possible
to pass FILE* across DLL boundaries.
Actually, i'm doing
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, ftpout);
in a small testprog (ftpout is a FILE*) to trace FTP-server responses.
The crux lies therein that on Win32 we've three (six with debug-runtimes)
different C-runtimes (singlethreaded, multithreaded, multithreaded DLL,
(debug singlethreaded, ...)).
You can pass around system resources (like FILE*) as long as your
links against the same C-runtime as libcurl!
So, in the above example i'm linking my testapp against the multithreaded
runtime (although it's singlethreaded, but only the opposite would bring
trouble... =) since libcurl links against the same.
If i would link against, let's say the singlethreaded static runtime, my
testapp will surely crash with a segmentation violation.
Hope that helps & Ciao, Markus
Mit freundlichen Gruessen - Kind regards
ORDAT GmbH & Co. KG - Serversystems / eCom
Dipl.-Inf. (FH) Markus Henke Fon: +49 (641) 7941-0
Rathenaustr. 1 Fax: +49 (641) 7941-132
35394 Gießen mailto:markus.henke_at_ordat.com
...this behavior is by design...
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
- application/octet-stream attachment: Markus_Henke.vcf