Hi,
i have written the code below to download files from the FTP Server.
DWORD FTPImport::ImportAllFiles ( const CString& csSource_i, CString& csDestination_o )
{
HINTERNET hInternet;
HINTERNET hConnect;
try
{
hInternet = InternetOpen( NULL, PRE_CONFIG_INTERNET_ACCESS, NULL, INTERNET_INVALID_PORT_NUMBER, 0 );
if ( NULL == hInternet )
{
return;
}
hConnect = InternetConnect( hInternet, m_csServerName, INTERNET_INVALID_PORT_NUMBER, m_csUserName,
m_csPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0 );
if( NULL == hConnect )
{
DWORD dwError = GetLastError();
return;
}
But the internet connection API always fails with error code 12007.
the server name i send is correct, so is the password and username.
Please please please do help..
i know this is a silly problem :(