what is the standard way to give file name in FtpOpenFile() [modified]
-
So now you have something akin to:
if (FtpOpenFile(hConnect, TEXT("C:\\good.txt"), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, NULL) == NULL)
DWORD dwError = GetLastError();"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
What does
GetLastError()
return?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
What does
GetLastError()
return?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
it returns 12003. Please note that the user name i am logging have all the rights.
modified on Thursday, February 07, 2008 10:47:15 AM
Which equates to
ERROR_INTERNET_EXTENDED_ERROR
. Did you then callInternetGetLastResponseInfo()
to get the error text?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Which equates to
ERROR_INTERNET_EXTENDED_ERROR
. Did you then callInternetGetLastResponseInfo()
to get the error text?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Tried as InternetGetLastResponseInfo(lpdwError, lpszBuffer, lpdwBufferLength); cout<<lpszBuffer; if this is correct, it have 00394BD8.
vptech19 wrote:
cout<<lpszBuffer;
cout << (LPCTSTR) lpszBuffer;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
vptech19 wrote:
cout<<lpszBuffer;
cout << (LPCTSTR) lpszBuffer;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
it is didn't work. if i use InternetGetLastResponseInfo() & ran the program means, it breaks the code. But FtpOpenFile() returns the error code as 6 now. where can i refer the error codes?
vptech19 wrote:
it is didn't work. if i use InternetGetLastResponseInfo() & ran the program means, it breaks the code.
So you have something like:
if (FtpOpenFile(hConnect, TEXT("C:\\good.txt"), GENERIC_READ, FTP_TRANSFER_TYPE_BINARY, NULL) == NULL)
{
DWORD dwError = GetLastError();
if (ERROR_INTERNET_EXTENDED_ERROR == dwError)
{
TCHAR szErrorText[256];
DWORD dwSize = sizeof(szErrorText);
InternetGetLastResponseInfo(&dwError, szErrorText, &dwSize);
}
}vptech19 wrote:
But FtpOpenFile() returns the error code as 6 now.
FtpOpenFile()
returns a handle to indicate success, andNULL
to indicate failure. Since6
is notNULL
, I can only assume thatFtpOpenFile()
is not failing."Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
it is didn't work. if i use InternetGetLastResponseInfo() & ran the program means, it breaks the code. But FtpOpenFile() returns the error code as 6 now. where can i refer the error codes?
vptech19 wrote:
where can i refer the error codes?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
vptech19 wrote:
where can i refer the error codes?
Mark Salsbery Microsoft MVP - Visual C++ :java:
I missed out some FTP configurations in Destination m/c, so now the FtpOpenFile() works fine. The FtpGetFile() throws 12110(ERROR_FTP_TRANSFER_IN_PROGRESS) error. Do i need to include some kind of delay after FtpOpenFile()?. To debug this i tried to login thro FTP to the source m/c(other m/c) - it is success. But i wan not able to login thro FTP to my m/c from the source m/c. I feel this may causing the problem. Do i need to set any configurations anything else mentioned in "https://engineering.purdue.edu/ECN/Support/KB/Docs/FTPSetUpWindows" and "http://articles.techrepublic.com.com/5100-6345-5031102.html".
-
I missed out some FTP configurations in Destination m/c, so now the FtpOpenFile() works fine. The FtpGetFile() throws 12110(ERROR_FTP_TRANSFER_IN_PROGRESS) error. Do i need to include some kind of delay after FtpOpenFile()?. To debug this i tried to login thro FTP to the source m/c(other m/c) - it is success. But i wan not able to login thro FTP to my m/c from the source m/c. I feel this may causing the problem. Do i need to set any configurations anything else mentioned in "https://engineering.purdue.edu/ECN/Support/KB/Docs/FTPSetUpWindows" and "http://articles.techrepublic.com.com/5100-6345-5031102.html".
After you've called FtpOpenFile(), the only operations you can do are InternetReadFile(), InternetWriteFile(), InternetCloseHandle(), or FtpFindFirstFile(). Once you've closed the file you can use FtpGetFile(). FtpGetFile() is meant to be used by itself - you don't need to (and can't) open the file first. You use FtpOpenFile()/InternetReadFile()/InternetCloseHandle() when you want more control over the file transfer. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
After you've called FtpOpenFile(), the only operations you can do are InternetReadFile(), InternetWriteFile(), InternetCloseHandle(), or FtpFindFirstFile(). Once you've closed the file you can use FtpGetFile(). FtpGetFile() is meant to be used by itself - you don't need to (and can't) open the file first. You use FtpOpenFile()/InternetReadFile()/InternetCloseHandle() when you want more control over the file transfer. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: