Of course casting can be used to cover up a multitude of sins, which don't involve reading the manual.
> INTERNET_FLAG_KEEP_CONNECTION || INTERNET_FLAG_PRAGMA_NOCACHE
Do you know the difference between | and || ?
> (char *)&szFile
Perhaps if you dropped the &, you could drop the cast as well?
I'm assuming from your use of hungarian notation that this is an array?
> (LPSTR *)lpMIME
To quote the manual page
Originally Posted by
msdn
lplpszAcceptTypes
[in] A pointer to a null-terminated array of strings that indicates media types accepted by the client. If this parameter is NULL, no types are accepted by the client. Servers generally interpret a lack of accept types to indicate that the client accepts only documents of type "text/*" (that is, only text documents—no pictures or other binary files). For more information and a list of valid media types, see
ftp://ftp.isi.edu/in-notes/iana/assi...es/media-types.
How is your array terminated with a NULL pointer?
Maybe
Code:
char *szMIME[] = {
"image/bmp",
NULL
};
Then perhaps you can pass szMime as a parameter without any casting, and without any copying?