Bonjour,

J'ai télécharger sur internet un projet (JFTP) qui gère la réception de fichiers via FTP. Je le compile, aucun problème.
Ensuite, je l'insère dans un projet MFC, et je ne parviens pas à me connecter sur le serveur FTP.
Que faudrait-il faire ?

J'ai identifié le lieu du problème
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "stdafx.h"
#include "global.h"

/* Connexion au serveur FTP */
boolean ConnexionFTP( char *Serveur, char *Login, char *MotDePasse, DWORD Port )
{
	PConnexionInternet = InternetOpen(L"J-FTP", INTERNET_OPEN_TYPE_DIRECT,/* NULL, NULL*/0,0, 0 );
	if ( PConnexionInternet == NULL ) <-- OK ICI, ne rentre pas
	{
		return FALSE;
		ExitProcess(1);
	}
  
	PConnexionFTP = InternetConnect( PConnexionInternet, (LPCWSTR)Serveur, (INTERNET_PORT)Port, (LPCWSTR)Login, (LPCWSTR)MotDePasse, INTERNET_SERVICE_FTP, 0, 0 );

	if ( PConnexionFTP == NULL ) <-- Rentre dedans, donc problème
	{
	    InternetCloseHandle( PConnexionInternet );
	    return FALSE;
	    ExitProcess(1);
	}

	return TRUE;

}

boolean changeRepertoire(char* newrep)
{
    return FtpSetCurrentDirectory(PConnexionFTP,L"ankamagam");
}

/* Detruit les pointeurs de connection */
void Deconnexion()
{
    InternetCloseHandle( PConnexionInternet );
    InternetCloseHandle( PConnexionFTP );
}

/* DownLoad Fichier */
boolean DownLoadFile( char *FichierSurFTP, char *FichierACreer )
{
    return FtpGetFile( PConnexionFTP, (LPCWSTR)FichierSurFTP, (LPCWSTR)FichierACreer, FALSE, 0, FTP_TRANSFER_TYPE_BINARY, 0 );
}

/* Upload Fichier */
void UpLoadFile( char *FichierLocal, char *FichierFTP )
{
    FtpPutFile( PConnexionFTP, (LPCWSTR)FichierLocal, (LPCWSTR)FichierFTP, FTP_TRANSFER_TYPE_BINARY, 0 );
}
Le problème pourrait être du au fait que le problème original n'utilise pas UNICODE, alors que moi, je DOIT m'en servir. Mais comme InternetOpen semble fonctionner, je ne pense pas vraiment que le probème vienne de là.

Quelqu'un aurait-il une solution ?