CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    Jul 2003
    Posts
    135

    Re: Function works during step through but not on regular run

    Quote Originally Posted by coolbiz
    Did you try that CLASS? It is based on the Microsoft sample (modified a little to make it work w/ OPTION EXPLICIT and OPTION STRICT set to ON) and it works for me w/o putting any delay. I've tried to access my local FTP server and a public FTP server on the internet.
    Yeah, that file looks pretty much identical to mine. I had a downloaded copy that I found on another site and it wasn't working so I then went to the microsoft site and did a copy paste of what they had in that example and still no go so in came the delay.

  2. #17
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Function works during step through but not on regular run

    I know that they are almost identical. I copied it from Microsoft website and made a little modification just to make it work w/ OPTION EXPLICIT and OPTION STRICT set to ON.

    I've made a test app that uses the modified class. Download this and compile to run it. Tell me if the problem still persists:
    Attached Files Attached Files
    Good Luck,
    -Cool Bizs

  3. #18
    Join Date
    Jul 2003
    Posts
    135

    Re: Function works during step through but not on regular run

    Quote Originally Posted by coolbiz
    I know that they are almost identical. I copied it from Microsoft website and made a little modification just to make it work w/ OPTION EXPLICIT and OPTION STRICT set to ON.

    I've made a test app that uses the modified class. Download this and compile to run it. Tell me if the problem still persists:
    Problem is still there. Your file list box shows:

    Code:
    Files in /sprint on ftp.ftpname.com:
    1: File1.jpg
    2:
    So I added the sleep delay of 10 ms in at the same place. Sure enough all 15 files poped up. Maybe the FTP server I'm connecting to is slow in its replies. On another note man your UI code is cleaner then mine.....

  4. #19
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167

    Re: Function works during step through but not on regular run

    Hmm ... that is the wierd thing. It works fine for me w/o putting the delay in and I've tried it on my home and work PC. I'm wondering if you have updated your .Net framework to the latest version. Maybe, there lies the problem.

    If that still does not solve your problem, I'd suggest to try out 3rd party component. There are bunch out there and some of them are pretty cheap
    Good Luck,
    -Cool Bizs

  5. #20
    Join Date
    Jul 2003
    Posts
    135

    Re: Function works during step through but not on regular run

    Quote Originally Posted by coolbiz
    Hmm ... that is the wierd thing. It works fine for me w/o putting the delay in and I've tried it on my home and work PC. I'm wondering if you have updated your .Net framework to the latest version. Maybe, there lies the problem.

    If that still does not solve your problem, I'd suggest to try out 3rd party component. There are bunch out there and some of them are pretty cheap
    Yeah its goofy but at least I have a decent work around. Everythings up to date (Dot Net v1.1 SP1 with the MS patches) and like I said the delay, even only a couple ms works fine so I can live with it. Thanks for your help.

    -Allan.

  6. #21
    Join Date
    Jul 2003
    Posts
    135

    Re: Function works during step through but not on regular run

    Tried the program from a couple other computers and a couple other servers. Sure enough I do think its server/connection/reply speed based. Some FTP's are just slower then others.

    On another note I needed to be able to CHMOD the files after I transfered them but that functionallity is not built into the Microsoft FTP class so I put it in myself, maybe it will help someone else:

    Code:
        ' Change a files attributes on the FTP Server.
        Public Sub CHMOD(ByVal sAttributes As String, ByVal sFileName As String)
    
            If (Not (m_bLoggedIn)) Then
                Login()
            End If
    
            SendCommand("SITE CHMOD " & sAttributes & " " & sFileName)
    
            If (m_iRetValue <> 200) Then
                MessageString = m_sReply
                Throw New IOException(m_sReply.Substring(4))
            End If
    
        End Sub
    -Allan

  7. #22
    Join Date
    Jun 2005
    Posts
    3

    Re: Function works during step through but not on regular run

    do one thing put some time delay in the function processing so that the machince will get the time to process the files...

Page 2 of 2 FirstFirst 12

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