Archived

This topic is now archived and is closed to further replies.

Assembler015

basic wininet help

Recommended Posts

Hey, I was wondering if someone could help me out quickly. I have the following code:
iopen = InternetOpen("myapp", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, INTERNET_FLAG_ASYNC);
	if(!iopen)
		return 1;

	ftp = InternetConnect(iopen, "andyerin.com", INTERNET_DEFAULT_FTP_PORT, "myusername", "mypassword", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, (DWORD_PTR)&value); 
	value = GetLastError();
InternetOpen succeeds, but when I call InternetConnect the function fails. GetLastError returns ''183'' which is: Cannot create a file when that file already exists. Anyone know why this is? Thanks for the help --Andrew

Share this post


Link to post
Share on other sites
Looks fine for me:
I used something like this


'open
LOG_Write ("FTP_CONNECT_B: " & Date$ & " " & Time$)
hISesion = InternetOpen("KCFTP", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0)
If hISesion = 0 Then
Handle = hISesion
GoTo FTP_Err
End If

'connect
hFTPSesion = InternetConnect(hISesion, Adres, INTERNET_DEFAULT_FTP_PORT, UId, Pwd, INTERNET_SERVICE_FTP, IIf(TrybPasywny, INTERNET_FLAG_PASSIVE, 0), 0)
If hFTPSesion = 0 Then
Handle = hISesion
GoTo FTP_Err
End If


So try to remove INTERNET_FLAG_ASYNC and put there 0 ???

[Edit]
1) Oh... and i wirte this for Access Database for FTP communication, so this is in Basic supported by Access 97
2) "andyerin.com" try "ftp.andyerin.com"
3) I fount this, i think it can be useful for You
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/enabling_internet_functionality.asp
ok and this one too http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/common_functions.asp


"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We Would
When Losers Say Its Over With You Know That It’s A Lie The Gods Made Heavy Metal And It’s Never Gonna Die"

THE GODS MADE HEAVY METAL/by
ManOwaR


[edited by - Estor on October 23, 2003 8:16:46 AM]

Share this post


Link to post
Share on other sites