CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    3

    Arrow problem when using GetFtpConnection from the CInternetSession class

    Hello every one, I have a problem when i call GetFtpConnection method from CInternetSession class, I call it as follows:

    ////////////////////////////////////////////////

    CInternetSession netSession;

    CFtpConnection *pFtp;

    CString SERVER_IP = "158.10.25.6";

    int PORT = 5000;



    TRY

    {

    pFtp = netSession.GetFtpConnection(SERVER_IP,"user","pass",PORT);

    }

    CATCH (CInternetException,ex)

    {

    char szError[100];

    memset(szError,0,100);

    ex->GetErrorMessage(szError,100);

    AfxMessageBox(szError);

    }

    END_CATCH

    ////////////////////////////////////////////////

    some times it successfully connected to the FTP server, but at some times it throw an exception told me that "Computer is disconnected from the network" , i don't know why however both the FTP server is on and connected to the network and also the client which contains this code is also on and connected to the network, so from where this error.



    Can you help me please, any help will be greatly appreciated.

    thank you

  2. #2
    Join Date
    Jun 2002
    Location
    Stockholm, Sweden
    Posts
    1,641

    Re: problem when using GetFtpConnection from the CInternetSession class

    I read that the Internet Explorer setting "work offline" can give this error.

    * Does it work one second and the next it fails?
    * Can you see any "pattern" or is it completely random?
    Nobody cares how it works as long as it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured