Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-01-2004, 02:21 PM
lecm lecm is online now
Registered User
 
Join Date: 08-11-2004
Posts: 3
How a Custom Action kwnows that the build is stopped or cancelled?

As the title says, how a custom action (made with vb6 for instance) can be notified that the build process was cancelled?
Reply With Quote
  #2  
Old 10-01-2004, 03:11 PM
kevina kevina is online now
Registered User
 
Join Date: 03-26-2003
Posts: 825
The information is available, but not as a COM event. You need to use WaitForSingleObject to check it's status.

The event is exposed via the CancelEvent propertly of the Builder object:
<snip from the help file>
Returns a handle to the Win32 event that will be set if the build is aborted. Read-only.

Syntax

builder.CancelEvent As Long
</snip>

The VB6 code to perform this check is:

' in declares section
Private Declare Function WaitForSingleObject Lib "kernel32" Alias "WaitForSingleObject" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

' in action's ICustomAction_BuildStep method
' should be called regularly during long a running action
' to check for cancellation of the build
If WaitForSingleObject(Builder.CancelEvent, 0) = 0 Then
ICustomAction_BuildStep = vbldStepStatAborted
Exit Function
End If
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 07:18 AM.


Copyright © 1999-2023 Kinook Software, Inc.