Hi, I am using your FTPSockClient, it's been working fine upto getting the file. GetFile function keeps on running it never returns. What could be the problem. My device is Symbol MC50 runs on Pocket PC 2003 and is connected to PC via USB connection. Thanks
ReplyOriginally posted by: Tony
i try to use the method getfile and i get the file empty but with the same size as the source file . please someone tell the sequence of method to use to get a file from ftp server
thanks
Originally posted by: Simone Sanfilippo
Hi, I use your code for implementing a ftp class for my application write in embedded Visual C++ 3 for Pocket Pc 2002 (device is Hp Jornada 565).
The GetFile member function do not work, I try it for transfer a text file from my ftp server to my \My Documents folder on pda. But the file in my pda doesn' exist and don't create this file when I call GetFile method.
My code is:
#include "FtpSockClient.h"
#include "Wininet.h"
CFtpSockClient ftp;
int MyApp::SetUpLocale()
{
BOOL bResult;
bResult = ftp.ConnectToServer(_T("192.168.0.105"), 21);
if(!bResult)
{
m_ctrTesto.SetWindowText(_T("Error"));
return 0;
}
bResult = ftp.UserLogin(L"anonymous", L"");
if(!bResult)
{
m_ctrTesto.SetWindowText(_T("Error"));
return 0;
}
bResult = ftp.GetFile(_T("txtfile.txt"), _T("\\My Documents\\txtfile.txt"));
if(!bResult)
{
m_ctrServer.SetWindowText(_T("File don't exist"));
}
else m_ctrServer.SetWindowText(_T("txtfile.txt"));
ftp.DisconnectFromServer();
}
There are errors?
Thanks
Simone
Originally posted by: Vikas Jain
I tried to use InterConnect() function in a Pocket PC application, but it gave me an error "This function is only valid in WIn32 mode". Amazingly, InternetOpen seems to be working.
Here is the code:
// prjFTP.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "Wininet.h"
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HINTERNET hOpenHandle, hConnectHandle, hResourceHandle;
LPVOID lpMsgBuf;
// Open Internet session.
if( (hOpenHandle = InternetOpen(L"Example",
INTERNET_OPEN_TYPE_PRECONFIG,
NULL,
INTERNET_INVALID_PORT_NUMBER,
0) ) == NULL)
{
MessageBox(NULL,L"Open failed",L"Tap OK",MB_OK);
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, L"Error", MB_OK | MB_ICONINFORMATION );
// Free the buffer.
LocalFree( lpMsgBuf );
}
if( (hConnectHandle = InternetConnect(hOpenHandle,
L"www.yourwebsite.com",
INTERNET_DEFAULT_FTP_PORT,
L"username",
L"password",
INTERNET_SERVICE_FTP,
0,
0)) == NULL)
{
MessageBox(NULL,L"Connect failed",L"Tap OK",MB_OK);
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, L"Error", MB_OK | MB_ICONINFORMATION );
// Free the buffer.
LocalFree( lpMsgBuf );
}
return 0;
}
I'll appreciate any comments on this.
Originally posted by: Nieves
Hello,
I'm building an applicaction in eMbedded Visual C++ and I'm using the Wininet functions for the FTP protocol implementation. When I run the aplication in the Emulator, it runs well, but whe I run the same application in the Pocket PC device I obtain the error 87 ("The parameter is incorrect").
I try with differentd parameters and allways I onbtein the same error.
Does somebody know why?
Thank you,
Nieves
ReplyOriginally posted by: SRinivas
hi,
i want to use CFtpsockClient in my project,but the problem is my projects settings use precompiled headers and the CFtpsockClient requires not suing pre compiled headers ,how do i solve this.??
regards,
srinivas
Originally posted by: xiaoxiao
CString CFtpSockClient::GetResponse( )
{
.....
while( ( csResp.Right(2) != CRLF ) )//CRLF=\r\n
{
int nRead = m_pCtrlSock -> Receive( &ch, 1, 0 );
//if the path include Chinese , it did not response . 汉字在这儿死机
csResp += ch;
}
......
}
If the path is composed by English、number or '_',This Programe is right.But the path including Chinese,eg./中国/
or /中国.txt,this programe haven't response.
Why is it?
Originally posted by: ezzi
I wanna convert Windows Programming.
I'd like to use for Winodws VC++.
Please.
Originally posted by: Scott Dunham
What does the afx stand for in <afxwin.h>?
ReplyOriginally posted by: Javier
Is there any ActiveX to develop FTP Clients in embedded Visual Basic???
thanks
Reply