Kevin
2008-09-10 21:53:43 UTC
Hi,
I have a very strange problem with FtpFindFirstFile. I have an application that
allows connection to an FTP server using one of 4 different methods:
* Internet direct connection (device in a dock connected to a PC via ActiveSync)
* dialup via modem and phone line (dialing into a modem bank)
* Internet dialup via tethered cell phone
* Internet dialup via Bluetooth cell phone
I'm using RAS functions for the connection, except for the direct/dock connection.
Only when I am connected via the tethered cell phone am I unable to get past the
FtpFindFirstFile function. It hangs, like it's blocking or something. It
apparently doesn't lock the device, just the application.
I think I have come to the end of my wits with this one. I've tried searching
the Internet for solutions, but I can't seem to find anything. Here is my
function call:
-----------
// Get the list of files from the FTP site.
CAppLog::Write(_T("Retrieving list of files from server"));
SendMessage(m_hWnd,WM_FTP_EVENT,FTP_EVENT_FILE_DIR_LIST,0);
hFileList = FtpFindFirstFile(
m_hFtpSession,
RemoteDirectory+csRemoteFilespec,
&ffData,
INTERNET_FLAG_NO_CACHE_WRITE,
0);
bMoreFiles = (hFileList != NULL);
while (bMoreFiles)
{
bFilesFound = TRUE;
csaFileList.AddTail(ffData.cFileName);
CAppLog::Write(_T(" %s"),ffData.cFileName);
nFilesFound++;
bMoreFiles = InternetFindNextFile(hFileList,&ffData);
}
if (hFileList)
{
InternetCloseHandle(hFileList);
}
CAppLog::Write(_T("%d file(s) found"),nFilesFound);
-----------
All of the messaging goes to a dialog, which is working properly. Basically, I'm
just trying to get a list of the files matching the filespec (which is typically
only a single filename) and download each file individually.
As I said before, this exact same code is being called regardless of the
connection method. Why is it hanging only on the tethered cell phone? *AND* why
does it hang in the exact same place every single time??
If anyone has any suggestions or experience with this, please let me know. All
of this code works, except for this one issue. If I can't resolve it, then I
have to find a different solution (like CSocket).
Thanks,
Kevin
I have a very strange problem with FtpFindFirstFile. I have an application that
allows connection to an FTP server using one of 4 different methods:
* Internet direct connection (device in a dock connected to a PC via ActiveSync)
* dialup via modem and phone line (dialing into a modem bank)
* Internet dialup via tethered cell phone
* Internet dialup via Bluetooth cell phone
I'm using RAS functions for the connection, except for the direct/dock connection.
Only when I am connected via the tethered cell phone am I unable to get past the
FtpFindFirstFile function. It hangs, like it's blocking or something. It
apparently doesn't lock the device, just the application.
I think I have come to the end of my wits with this one. I've tried searching
the Internet for solutions, but I can't seem to find anything. Here is my
function call:
-----------
// Get the list of files from the FTP site.
CAppLog::Write(_T("Retrieving list of files from server"));
SendMessage(m_hWnd,WM_FTP_EVENT,FTP_EVENT_FILE_DIR_LIST,0);
hFileList = FtpFindFirstFile(
m_hFtpSession,
RemoteDirectory+csRemoteFilespec,
&ffData,
INTERNET_FLAG_NO_CACHE_WRITE,
0);
bMoreFiles = (hFileList != NULL);
while (bMoreFiles)
{
bFilesFound = TRUE;
csaFileList.AddTail(ffData.cFileName);
CAppLog::Write(_T(" %s"),ffData.cFileName);
nFilesFound++;
bMoreFiles = InternetFindNextFile(hFileList,&ffData);
}
if (hFileList)
{
InternetCloseHandle(hFileList);
}
CAppLog::Write(_T("%d file(s) found"),nFilesFound);
-----------
All of the messaging goes to a dialog, which is working properly. Basically, I'm
just trying to get a list of the files matching the filespec (which is typically
only a single filename) and download each file individually.
As I said before, this exact same code is being called regardless of the
connection method. Why is it hanging only on the tethered cell phone? *AND* why
does it hang in the exact same place every single time??
If anyone has any suggestions or experience with this, please let me know. All
of this code works, except for this one issue. If I can't resolve it, then I
have to find a different solution (like CSocket).
Thanks,
Kevin