Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#1

Probleme mit API-Funktiosaufruf

  Alt 20. Jun 2002, 10:13
Hi.
ich programmiere gerade einen einfachen FTP-Client ohne VCL
Nicht, dass ich ihn ersthaft nutzen will, es ist eigentlich nur eine Studie.

Nun habe ich aber mit folgender API-Funktion Probleme:
Code:
FTPGetCurrentDirectory()
Aus dem PSDK:
Zitat:
Retrieves the current directory for the specified FTP session.

Syntax

Code:
BOOL FtpGetCurrentDirectory(          HINTERNET hConnect,
    LPTSTR lpszCurrentDirectory,
    LPDWORD lpdwCurrentDirectory
);
Parameters

hConnect
[in] Valid handle to an FTP session.

lpszCurrentDirectory
[out] Pointer to a buffer that receives the current directory string, which specifies the absolute path to the current directory. The string is null-terminated.

lpdwCurrentDirectory
[in, out] Pointer to 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.
Aufrufen tue ich sie wie folgt:
Code:
var
  szCurDir: array[0..255] of Char;
  lenDir: DWORD;
begin
  ...
  FTPGetCurrentDirectory(hFTPSession, szCurDir, lenDir);
Nur ist bei mir szCurDir immer leer und lenDir immer 0.

Wie rufe ich die Funktion also richtig auf? Denn irgendwas mache ich da falsch.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat