Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with FtpSetCurrentDirectory()

Status
Not open for further replies.

culleoka

Programmer
May 16, 2002
85
0
0
US
I have the following code in a program:

#DEFINE INTERNET_FLAG_PASSIVE 134217728

DECLARE INTEGER FtpSetCurrentDirectory IN wininet;
INTEGER hftpSession, ;
STRING cPath

hOpen = InternetOpen (sAgent, 1,;
sProxyName, sProxyBypass, lFlags)

fPath='/ajp/entry/ajp89f01/ADLRECVD'

hftpSession = InternetConnect (hOpen, lcHost,;
0, lcUser, lcPwd, 1, INTERNET_FLAG_PASSIVE, 0)

WAIT WINDOW 'Geting Directory Listing'

= FtpSetCurrentDirectory(hftpSession,fPath)

Wait Window 'Finished Changing Directory'

The program works for downloading files I specify using FtpGetFile() without problem. However it hangs on the FtpSetCurrentDirectory() command. Just locks up.
I am reasonable sure the Declare statement is correct. So it is probably what I am passing as parameters to the function.
Can anyone tell what is wrong with the FtpSetCurrentDirectory command?

Pat McGreevy
 
I believe for Visual Basic you need to use fixed length strings when calling API's.
 
Pat

You declaration looks fine although it looks like VFP declaration rather then VB
Do you get a returned value from
Code:
= FtpSetCurrentDirectory(hftpSession,fPath)

Is it something orther than 1?

Have you tried?
Code:
IF FtpSetCurrentDirectory(hftpSession, ALLTRIM(fpath)) <> 1
			RETURN 0
		ELSE
			RETURN 1
		ENDIF


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top