Here is an example of using the XceedQuickFtp control's ReceiveFile method with ATL. Includes error handling. Uses the #import compiler directive.
Visual C++ ATL |
Copy Code |
#import "XceedFtp.dll" named_guids no_namespace
CoInitialize( NULL );
try { IXceedQuickFtpPtr piQuickFtp( CLSID_XceedQuickFtp ); piQuickFtp->License( _bstr_t( L"your license key ) );
piQuickFtp->ReceiveFile( "192.168.0.200", 21, "anonymous", "guest", "ReadMe_Sent.txt", "E:\\ReadMe_Received.txt", FALSE ); } catch ( const _com_error xErr ) { printf( "Error: %s\n", ( const WCHAR* ) xErr.Description ); } catch( ... ) { printf( "Unexpected error" ); }
CoUninitialize(); return 0;
|