Que tal amigos. Me gustaría me hechaseis una mano
Llevo todo el día intentando poder conectarme vía FTP
a un servidor para trasmitir unos archivos que genero en el programa en lenguaje eVB. En Vb me funciona perfectamente con la librería WinInet.Dll, pero en embeded cuando llego a la sentencia hConnection se me queda Clavado.
el Código que utilizo es el siguiente.
Public Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUserName As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Public Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hConnect As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
Public Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
Public Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Const INTERNET_OPEN_TYPE_PRECONFIG = 0
Const INTERNET_DEFAULT_FTP_PORT = 21
Const INTERNET_SERVICE_FTP = 1
Const PassiveConnection As Boolean = True
Const INTERNET_FLAG_PASSIVE = &H8000000
Const FTP_TRANSFER_TYPE_UNKNOWN = &H0
Dim hConnection, hOpen, Num As Long
Public Sub GPConentaFTP()
hOpen = InternetOpen("lalala", INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
hConnection = InternetConnect(hOpen, "ftp", INTERNET_DEFAULT_FTP_PORT, "usuario", _
"contraseña", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0)
FtpSetCurrentDirectory hConnection, "TPV"
FtpPutFile hConnection, "C:\CABECERA.PDA", "PDA.PDA", FTP_TRANSFER_TYPE_UNKNOWN, 0
InternetCloseHandle hConnection
InternetCloseHandle hOpen
End Sub
....
...
En qué está fallando.
Muchas gracias por leer mi mensaje.