Microsoft® ActiveX® replication controls provide a Status event that reports status and percent complete during the Run method. The event is useful for displaying information in the application, such as a percent complete bar. The event also supports the ability to cancel the control process.
This example demonstrates how a Microsoft Visual Basic® program can display a progress bar and handle a Cancel method call.
Dim WithEvents oSQLDistribution As SQLDistribution
Function oSQLDistibution_Status (ByVal Message As String, ByVal Percent As Long) As STATUS_RETURN_CODE
ProgressBar.Value = Percent
ProgressLabel.Caption = Message
‘If the global flag is set, stop the control
If gfCancel = TRUE
oSQLDistribution = CANCEL;
‘Must allow the message loop to handle other events
DoEvents
End Function