Login  
Search All Forums
Dart Home | PowerTCP FTP for ActiveX | Custom Development Reply | PowerTCP FTP for ActiveX Topics | Forums   
AuthorForum: PowerTCP FTP for ActiveX
Topic: Progress Event
tjernblom

From: Stockholm, Sweden
Posts: 5
Member Since: 10/27/05
posted October 27, 2005 9:32 AM


Hi!

We are testing PowerTCP FTP in asynchronous mode (timeout=0), and we really love the control.

But we are experiencing some difficulties with the progress event. Uploads/downloads are made in the background, and sometimes our application shows a message box ("Please wait for the upload to finish before exiting" for instance).

When a message box is shown, no progress events are triggered. That's ok. But they are not buffered, and triggered after the message box has been closed. Thus our application will never know if the upload/download has finished.

Is there any work around for this problem?
/anders


Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 27, 2005 9:43 AM

You can't put modal dialogs (like a MessageBox) up while you are in the middle of a transfer. You will have to use some other means of keeping the user from taking the next step. For example, disable buttons.
tjernblom

From: Stockholm, Sweden
Posts: 5
Member Since: 10/27/05
posted October 27, 2005 9:51 AM


Why? When using the Trace function all events are logged as expected, even if a modal dialog is up.
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted October 27, 2005 9:53 AM

I'm not sure, I guess the tracing is keep the message pump moving.

In any event, you shouldn't put up modal message boxes when in the middle of a transfer.

tjernblom

From: Stockholm, Sweden
Posts: 5
Member Since: 10/27/05
posted October 27, 2005 10:10 AM


That's why we wanted to use asynchronous ftp, so the user would be able to do other things in the application while an upload/download is in progress. We have to be able to show message boxes, without making the ftp handling unstable.

Maybe we will continue using our synchronous wininet solution.
e-roq

From: Mentone, CA USA
Posts: 18
Member Since: 09/27/03
posted November 2, 2005 2:49 AM

I think this may be what yo are looking for. There is a small demo called "Keep background processes running while showing MsgBox" in the demos.

http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=62835&lngWId=1

Here's the code:
Preparations


Add 2 Command Button (named Command1 and Command2)
Add 1 Label (named Label1)
Add 1 Timer Control. Set the Timer Interval property to 1

Module Code


Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As _
Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As _
Long) As Long

Form Code


Private Sub Command1_Click()
MsgBox "The Timer STOPS!"
End Sub

Private Sub Command2_Click()
MessageBox Me.hwnd, "Notice the timer does not stop!", "API Call", _
vbOKOnly + vbExclamation
End Sub

Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub
tjernblom

From: Stockholm, Sweden
Posts: 5
Member Since: 10/27/05
posted December 19, 2005 10:44 AM

Thanks e-roq! Made it a little bit better, although not completely stable.
Reply | PowerTCP FTP for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX