FtpSetCurrent Directory(); Error: 997



  • Hallo,

    Bei meinem Programm, wo ich Dateien aus einem Server auslesen will, benutze ich

    FtpSetCurrentDirectory(hFtpSession,"Bilder");
    

    dabei kommt aber mit GetlastError Fehlercode 997, also "Überlappender E/A- Vorgang wird verarbeitet.".
    Mein Code:

    hInternet = InternetOpen("Update",0,NULL,NULL,INTERNET_FLAG_ASYNC);
    if (hInternet == NULL)
    {
    MessageBox(hwnd,"Initialisieren fehlgeschlagen!","Error!",MB_ICONERROR);
    
    }
    hFtpSession = InternetConnect(hInternet,"www.*******.bplaced.net",INTERNET_DEFAULT_FTP_PORT,"*****","*******",INTERNET_SERVICE_FTP,0,0);
    
    if (hFtpSession == NULL){
    MessageBox(hwnd,"Konnte nicht verbinden!","Error!",MB_ICONERROR);
    return FALSE;
    }
    
    bSuccess = FtpSetCurrentDirectory (hFtpSession,"Bilder");
    
    if (bSuccess == FALSE){
    
        LPVOID lpMsgBuf;
        LPVOID lpDisplayBuf;
        DWORD dw = GetLastError(); 
    
        FormatMessage(
            FORMAT_MESSAGE_ALLOCATE_BUFFER | 
            FORMAT_MESSAGE_FROM_SYSTEM |
            FORMAT_MESSAGE_IGNORE_INSERTS,
            NULL,
            dw,
            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
            (LPTSTR) &lpMsgBuf,
            0, NULL );
    
    sprintf(Url,"Errorcode :%d",dw);
    MessageBox(hwnd,lpMsgBuf,Url,MB_ICONERROR);
    return FALSE;
    }
    

    MfG, Andrew



  • Hallo,

    immer wieder mal gefragt, das ist normal, wenn man für die Aufrufe "asynchron" (INTERNET_FLAG_ASYNC) festlegt. Entweder den Modus entfernen, oder nachlesen, wie man vorgehen muss, wenn man asynchron arbeiten will.

    MfG,

    Probe-Nutzer



  • Super DANKE dir,
    jetzt gehts endlich!

    MfG, Andrew


Anmelden zum Antworten