Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CFtpConnection::Command() - Last attempt before madness :)

CFtpConnection::Command() - Last attempt before madness :)

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studiosysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    carrie
    wrote on last edited by
    #1

    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 :)

    A 1 Reply Last reply
    0
    • C carrie

      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 :)

      A Offline
      A Offline
      Arjan Schouten
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • A Arjan Schouten

        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

        C Offline
        C Offline
        carrie
        wrote on last edited by
        #3

        Nope, I tried that a couple of days ago but no luck. I've tried it on a couple of different servers and using different commands but didn't help :( Thanks for replying though :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups