| ActivePatch Developer's Guide - Progress Notification | ||
|
In some cases, it may be desirable for the application to display a progress bar or use some other user interface object to indicate the progress of the current application. To do this, simply add code to the control's Progress event. This event is called periodically throughout the patch and package creation and application process, and specifies the current completion status as a percentage value between 0 and 100. In general, progress notification is useful during the process of creating a patch file or package. Depending on the size and number of changes in the reference and update files, patch or package creation can take a long period of time. However, the application process generally takes very little time, therefore, a progress bar may not be necessary unless a large number of files are being updated. |
||
| Canceling Operations | ||
|
The Cancel method can be used to cancel the creation or the application of a patch file. When an operation is canceled, it will result in the Create or Apply method failing and an error will be generated. The application must trap this error, otherwise the program will terminate at that point. Here is an example of how this could be handled: PatchFile1.FileName = strPatchFile
PatchFile1.Options = apDefaultOptions
PatchFile1.Level = apDefaultLevel
On Error GoTo Failed
PatchFile1.Create strOldFile, strNewFile
Exit Sub
Failed:
If Err.Number = apErrorOperationCanceled Then
' The operation has been canceled
Exit Sub
Else
' Another error has occurred, display information
' about the error to the user
MsgBox Err.Description
End If
|
||