CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1

    Async FTP exception

    Environment:
    VC++ 5.0 Win95/NT 4.0

    I am having difficulty setting up an Asynchronous FTP session in order to
    ftp multiple files while providing a progress status through a dialog box.
    I have set up the code according to the MFC documentation including creating
    a call back function but 'GetFtpConnection' throws an exception: "Overlapped
    IO operation in progress".

    Can some one tell me what is wrong here? The code snippet follows..

    void CFTPExport::OpenFTPSession()
    {
    m_pInetSession = new CInternetSession( NULL, 1, INTERNET_OPEN_TYPE_DIRECT,
    NULL, NULL, INTERNET_FLAG_ASYNC);
    try
    {
    success = m_pInetSession->EnableStatusCallback();
    }
    catch (CInternetException* pEx)
    {...}
    try
    {
    m_pFTPConnection=
    _pInetSession->GetFtpConnection( (LPCTSTR)m_ftpHost_address,
    (LPCTSTR)m_ftpHost_username, (LPCTSTR)m_ftpHost_password, m_export_port,
    FALSE );
    }
    catch (CInternetException* pEx)


    Gets the Exception "Overlapped IO operation in progress".
    }
    void CInternetSession::OnStatusCallback( DWORD dwContext, DWORD
    dwInternetStatus, LPVOID lpvStatusInformation, DWORD
    dwStatusInformationLength)
    {...}


    Steve White





  2. #2
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    Re: Async FTP exception

    Hi.

    Check Advanced FTP from MSDN help at VC6.
    Otherwise, check MS support page.
    You will get sample code and detail documentation.

    These codes call API function directly.
    Did you set InternetOpen func first?

    First, I try to use CFtpConnection class, but I can't reach my
    mail server dirctory. So I use API func directory.

    HTH.
    -Masaaki Onishi-


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured