Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFtpConnection GetFile Question

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I am trying to use a string (not CString) variable in the GetFile to represent the remote file. When I try to compile I get this error message:

C:\Current_Projects\JTraderFTP\JTraderFTP.cpp(83) : error C2664: 'GetFile' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.

I have searched Google and have not found any information on the restriction of utilizing regular strings vs. CString variables in GetFile. The GetFile statement is as follows:

ftpConnection->GetFile(RFile, &quot;C:\\dumped\\newfile.txt&quot;, FALSE);

Any help on this subject (or point me to the right area to look up the information) is greatly appreciated. Thanks.

Dave Christman
 
GetFile requires a pointer to a C style string as its first argument. It looks like the name of your string variable is RFile. If this is the case, the following should work..

Code:
ftpConnection->GetFile(RFile.c_str() , &quot;C:\\dumped\\newfile.txt&quot;, FALSE);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top