CFtpConnection::Command() - Last attempt before madness :)
-
I thought I'd have one last try to see if I can get some help on this, sorry to all who are sick of seeing me post this, think its the 3rd time :) I'm using VS.Net with MFC and I'm using the CFtpConnection class. There is a member function, Command, which will allow you to create new commands to send to the ftp server and get responses back. I'm really needing to use this but I'm having a problem getting a response back from the server :( The problem is the 2nd parameter. My code just now is
CInternetFile* responseFile = ftp1->Command(pasvCommand,ftp1->CmdRespRead,FTP_TRANSFER_TYPE_ASCII);
ftp1 is a valid connected cftpconnection object and pasvCommand is just the string PASV for sending to the server. The 2nd parameter is the one that specifies if you want a response or not and is defined in the afxinet.h header as an enum with CmdRespRead the one for getting a response back. Setting the 2nd parameter in the call as CmdRespRead will throw a compiler error that its unrecognised, by using ftp1->CmdRespRead it will compile but doesn't take a response back from the server. Does anyone know what I should put in here because I'm about to delete this project and start work on a winsock version if I can't get it fixed, not good as I know nowt about winsocks :) Thanks all who read & can help :) -
I thought I'd have one last try to see if I can get some help on this, sorry to all who are sick of seeing me post this, think its the 3rd time :) I'm using VS.Net with MFC and I'm using the CFtpConnection class. There is a member function, Command, which will allow you to create new commands to send to the ftp server and get responses back. I'm really needing to use this but I'm having a problem getting a response back from the server :( The problem is the 2nd parameter. My code just now is
CInternetFile* responseFile = ftp1->Command(pasvCommand,ftp1->CmdRespRead,FTP_TRANSFER_TYPE_ASCII);
ftp1 is a valid connected cftpconnection object and pasvCommand is just the string PASV for sending to the server. The 2nd parameter is the one that specifies if you want a response or not and is defined in the afxinet.h header as an enum with CmdRespRead the one for getting a response back. Setting the 2nd parameter in the call as CmdRespRead will throw a compiler error that its unrecognised, by using ftp1->CmdRespRead it will compile but doesn't take a response back from the server. Does anyone know what I should put in here because I'm about to delete this project and start work on a winsock version if I can't get it fixed, not good as I know nowt about winsocks :) Thanks all who read & can help :)I don't no anything about this but did you check the return value. If responseFile == 0 you can call GetLastError to get some more information why the call failed. Can you get a response back from the server by sending a different command? If every fool wore a crown, we would all be king - Lard
-
I don't no anything about this but did you check the return value. If responseFile == 0 you can call GetLastError to get some more information why the call failed. Can you get a response back from the server by sending a different command? If every fool wore a crown, we would all be king - Lard