Click to See Complete Forum and Search --> : Async FTP exception


Steve White
April 19th, 1999, 09:49 AM
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

Masaaki
April 19th, 1999, 10:45 AM
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-