Right:<br>
<br>
I've started to use WinINet (thanks for the tip). However, this is my first attempt at using any of the API things. I've managed to declare all the functions I want, and I've managed to get an FTP connection open and send and receive files using it. There is a function called FtpGetCurrentDirectory that I'm trying to use, and I can't get it to work properly. Here's the declare statement:<br>
<br>
Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias "FtpGetCurrentDirectoryA" _<br>
(ByVal hConnect As Long, _<br>
ByRef lpszCurrentDirectory As String, _<br>
ByRef lpdwCurrentDirectory As Long) As Boolean<br>
<br>
Here's the detail from the MSDN page:<br>
<br>
Syntax<br>
<br>
BOOL FtpGetCurrentDirectory(<br>
IN HINTERNET hConnect,<br>
OUT LPTSTR lpszCurrentDirectory,<br>
IN OUT LPDWORD lpdwCurrentDirectory<br>
);<br>
The actual syntax of this function varies between its ANSI and Unicode implementations. For more information, see Win32 Internet Functions Syntax.<br>
<br>
Parameters<br>
<br>
hConnect <br>
Valid handle to an FTP session. <br>
lpszCurrentDirectory <br>
Address of a buffer that receives the current directory string, which specifies the absolute path to the current directory. The string is null-terminated. <br>
lpdwCurrentDirectory <br>
Address of a variable that specifies the length, in characters, of the buffer for the current directory string. The buffer length must include room for a terminating null character. Using a length of MAX_PATH is sufficient for all paths. When the function returns, the variable receives the number of characters copied into the buffer. <br>
Return Value<br>
<br>
Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.<br>
<br>
<br>
When I call it with my FTP connection, an empty string and 0 for the last parameter, I get false returned and the value of the last parameter is set to 16. When a try calling it with a non zero character for the last parameter, the whole thing just crashes with an Exception:Access Violation message<br>
<br>
Help!!!<br>
<br>
Jonathan