OVH Cloud OVH Cloud

Fonction DoFileDownload

3 réponses
Avatar
magma
Comment utiliser la fonction "DoFileDownload" de la librairie "shdocvw.dll"
en C ?

3 réponses

Avatar
Christian ASTOR
magma wrote:

Comment utiliser la fonction "DoFileDownload" de la librairie "shdocvw.dll"
en C ?



Par ex =>

{
HRESULT (FAR STDAPICALLTYPE * pDFD)(LPCWSTR pwszURL);
char sURL[MAX_PATH];
WCHAR sWideURL[MAX_PATH];
HRESULT hr;
HINSTANCE hInst = LoadLibrary("shdocvw.dll");
if (hInst)
{
(FARPROC&)pDFD = GetProcAddress(hInst, "DoFileDownload");
if (pDFD)
{
strcpy(sURL, "ftp://ftp.microsoft.com/Softlib/index.txt");
MultiByteToWideChar(CP_ACP, 0, sURL, -1, sWideURL, sizeof(sWideURL));
hr = pDFD(sWideURL);
}
}
}
// + FreeLibrary(hInst); qd fini
Avatar
dark poulpo
si ca tinterresse, jai fais une classe (pas tres compliquer à retranscrire
uniquement en C) qui permet de lire et écrire des fichiers sur disque
dur/http/ftp de maniere transparente avec le meme code ( c une version light
de stdio.h )
http://www.cppfrance.com/code.aspx?id0246

--
-----
http://dark.freezee.org/
http://www.dark-team.cjb.net/
Avatar
patate
regarde aussi
URLDownloadToFile

C'est peut etre plus simple.

pat.

"magma" wrote in message
news:42497f48$0$12195$
Comment utiliser la fonction "DoFileDownload" de la librairie
"shdocvw.dll"
en C ?