The following is partial code I downloaded from
DECLARE INTEGER InternetOpen IN wininet;
STRING sAgent, INTEGER lAccessType, STRING sProxyName,;
STRING sProxyBypass, STRING lFlags
DECLARE INTEGER InternetConnect IN wininet.DLL;
INTEGER hInternetSession,;
STRING lcHost,;
INTEGER nServerPort,;
STRING lcUser,;
STRING lcPassword,;
INTEGER lService,;
INTEGER lFlags,;
INTEGER lContext
sProxyName = CHR(0) &&... no proxy
sProxyBypass = CHR(0) &&... nothing to bypass
lFlags = 0 &&... no flags used
hOpen = InternetOpen (sAgent, 1,;
sProxyName, sProxyBypass, lFlags)
hftpSession = InternetConnect (hOpen, lcHost,;
0, lcUser, lcPwd, 1, 0, 0) &&... 1 = ftp protocol
I have run the code, and it connects to our FTP server fine.
But then I get the error 'Unable to download selected file.'
My question is:
1. What value should be passed to the InterConnect() function to set the INTERNET_FLAG_PASSIVE Flag?
FTP downloads on this particular server must be in Passive mode, not Active. All Microsoft lists for a value in it's API Flags constants is 0x08000000 for the constant value. Isn't this a hex value? I think this is the value I need as Integer.
Thanks in advance for any help, and thanks to Dave Summers for the code to get me to a starting point.
Pat McGreevy
DECLARE INTEGER InternetOpen IN wininet;
STRING sAgent, INTEGER lAccessType, STRING sProxyName,;
STRING sProxyBypass, STRING lFlags
DECLARE INTEGER InternetConnect IN wininet.DLL;
INTEGER hInternetSession,;
STRING lcHost,;
INTEGER nServerPort,;
STRING lcUser,;
STRING lcPassword,;
INTEGER lService,;
INTEGER lFlags,;
INTEGER lContext
sProxyName = CHR(0) &&... no proxy
sProxyBypass = CHR(0) &&... nothing to bypass
lFlags = 0 &&... no flags used
hOpen = InternetOpen (sAgent, 1,;
sProxyName, sProxyBypass, lFlags)
hftpSession = InternetConnect (hOpen, lcHost,;
0, lcUser, lcPwd, 1, 0, 0) &&... 1 = ftp protocol
I have run the code, and it connects to our FTP server fine.
But then I get the error 'Unable to download selected file.'
My question is:
1. What value should be passed to the InterConnect() function to set the INTERNET_FLAG_PASSIVE Flag?
FTP downloads on this particular server must be in Passive mode, not Active. All Microsoft lists for a value in it's API Flags constants is 0x08000000 for the constant value. Isn't this a hex value? I think this is the value I need as Integer.
Thanks in advance for any help, and thanks to Dave Summers for the code to get me to a starting point.
Pat McGreevy