General information
Category:
ActiveX controls in VFP
Alvin,
I did all of this about two years ago with Mabry. It's a little strange getting used to it, but once you know how they want to do it, it works very well.
I don't have this in front of me, but from memory, it goes something like this:
First, you have to look into the Synchronous/Asychronous property for file transfers. This is documented pretty well in the documentation (once you know that that's what you are looking for). You want the setting that returns control to VFP immediately after the command is executed.
Because command is returning to VFP, you have to write a wrapper around the command, something like this:
MyForm.FlagProperty = .f.
_Vfp.Autoyield = .f.
MyMabryControl.SomeTransferCommand
DO WHILE ! MyForm.FlagProperty
DoEvents &&--Don't worry, does not slow down program
ENDDO
You then code up the Mabry event (again, can't recall exactly which one after two years) that fires during progress. This event will return a code when the transfer is finished, and you can set your flag MyForm.FlagProperty to true to drop out of the loop.
Because you are looping through a DoEvents, controls on your form will respond to user input, so you can put a command button on the form for "Cancel" When the user clicks here, ask them a question to make sure they really want to cancel, and then... here I really can't remember, I think you set a property of the Mabry control from within the progress event.
After you've digested this, let me know if you need more, maybe I can dig up that code....
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only