|
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
|
|
|
|
|
this is also didn't work out.
|
|
|
|
|
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 call InternetGetLastResponseInfo() 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
|
|
|
|
|
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, and NULL to indicate failure. Since 6 is not NULL , I can only assume that FtpOpenFile() 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
|
|
|
|
|
vptech19 wrote: where can i refer the error codes?
System Error Codes[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
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++
|
|
|
|
|
Yes, you are correct. Now upload and download both works fine.
Thanks a lot Mark, David and all.
-vp
|
|
|
|
|
Hi all
I wanna make myold application tool bar in to vista Aero vista theme tool bar
can some one tell me how to start off?
can some one tell me abt color tool bar.. how can i create color tool bar
CToolbar::OnEraseBkGrnd() will be help full to paint color to tool bar? coz i tried it its not painting the color
can some one help me with solution r give me some pointers
|
|
|
|
|
|
Hi Experts,
I m trying to load an Image file(jpeg/png/gif/bmp)
of 900x630 into a bitmap on my classview(OnPaint)..
But wen i run i m realisin loss of color in my loaded image..
wats the reason for loss of color during bitmap loading..
Thanks in advance..
Gita
|
|
|
|
|
Without seeing any code it's hard to say what your problem is, but the biggest reason for color loss would be an incorrect HDC. When dealing with bitmaps, I usually get the desktops DC and make a compatible DC from that, this should then enable you to have access to the full color range.
Waldermort
|
|
|
|
|
WalderM ...this should then enable you to have access to the full color range.
Are there other DCs that wouldn't?
"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
|
|
|
|
|
My point is, if you simply create a DC then it can only handle monochrome images. If you use a DC given to you by some other means, then you can never be sure of it's configuration.
Waldermort
|
|
|
|
|
Hi Waldermors,
I ve given my followin snippet for ur' clarification..
CDC dcMemory;//Create a compatible memory device context
dcMemory.CreateCompatibleDC(pDC);
CBitmap bmImage;//Load and select bitmap
bmImage.LoadBitmap(IDB_BITMAP4);
CBitmap *pbmOriginal = dcMemory.SelectObject(&bmImage);
dcMemory.SetMapMode( pDC ->GetMapMode());
CRect rcClient;
GetClientRect(rcClient);
pDC ->StretchBlt(rcClient.left,rcClient.top,rcClient.Width(),
rcClient.Height(), &dcMemory,0,0,50,50,SRCCOPY);
pDC ->SelectObject (pbmOriginal);
pDC ->SetBkMode(TRANSPARENT);
wats' the prob r deficiency in my above snippet..
Gita
|
|
|
|
|
Hello,
if i have a vertical scrollbar in my control, can i catch the event when i beginn to scroll?
Thanks in advance!
termal
|
|
|
|
|
WM_VSCROLL or if using MFC OnVScroll()
Waldermort
|
|
|
|
|
Hello,
i try this, but something is wrong in my code!
I write ON_WM_VSCROLL() in message list, and a funktion in my class:
void afx_msg CMyDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
void afx_msg CMyDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
AfxMessageBox(L"Hello from scroll");
}
But this dont work, execution never call this function!!
Thanks for your answer!
termal
|
|
|
|
|
If you have a scroll bar in your control, then the *control* will get the scoll message, not the dialog. You can subclass the control to do specific handling of the vscroll message.
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Do you have any scrollbar on your dialog?
|
|
|
|