PDA

View Full Version : How to use ProgressMax and ProgressIncrement



SGorman
07-14-2005, 02:48 PM
I cannot find reference to either of these events from the ISWiRelease Build method (automation interface) and I've searched the whole community.

I've implemented these in my VB project. The events only appear to kick off when the build finishes?? When the build finishes I get a value of zero for ProgressIncrement and a value of 100 for ProgressMax.

Anyone got any helpful hints on these?

SGorman
07-15-2005, 09:28 AM
Someone explained to me that you have to call Application.DoEvents() in order to get the form to update dynamically. Once I did this the progress values seem to be working.

ProgressMax resets itself to a new number everytime a new "set" of actions are started by the build process.
ProgressIncrement changes as it performs the current process incrementing until it reaches whatever value ProgressMax is.

Unfortunately, there is no way to get an overall build status, but at least you can get some sort of status indicator.

StatusMessage puts out just about all the same messages as go into the log file, as best as I can tell. However, if your error occurs before the log file starts, then you are out of luck.

kmoulton
08-01-2005, 04:57 PM
Someone explained to me that you have to call Application.DoEvents() in order to get the form to update dynamically. Once I did this the progress values seem to be working.

What is Application.DoEvents()?

I am working on building our software using the automated build process.
I am using Perl and would like to see the status messages when I build the release. Do you have any idea what you do to be able to display the status messages from the automated build?

Thanks,

--Kim

sbrinkmeyer
08-02-2005, 06:02 PM
application.doevents is c#

this is how i use it, in c# during the build process

for the build i selected the config and the release


ISWiAuto10.ISWiProductConfig productConfig = p.ISWiProductConfigs[1];
ISWiAuto10.ISWiRelease release = productConfig.ISWiReleases[1];

i then created event handlers for the specific events


release.ProgressIncrement +=new __ISWiRelease_ProgressIncrementEventHandler(release_ProgressIncrement);
release.ProgressMax +=new __ISWiRelease_ProgressMaxEventHandler(release_ProgressMax);

i implemented them as such


private void release_ProgressIncrement(int lIncrement, ref bool pbCancel)
{
progressBar1.Value=lIncrement;
progressBar1.Refresh();
Application.DoEvents();
}

private void release_ProgressMax(int lMax, ref bool pbCancel)
{
int nTest = lMax;
}


i then kick off the build


release.build


i assume you are going to have to use the com interface from PERL but i do not know how that would look. hope this gives some help :o

sbrinkmeyer
08-02-2005, 06:17 PM
for the status message you need to implement an event handler for


release.StatusMessage +=new ISWiAuto10.__ISWiRelease_StatusMessageEventHandler(release_StatusMessage);


and do something like


private void release_StatusMessage(string sMessage, ref bool pbCancel)
{
LogMessage("Build Status: " + sMessage);
}

p.s. sorry, i grabbed some ISX com interop code

we found out this information by using the Object Browser built in to the ide for Microsoft Visual Studio 2003. we found some references in the documentation and then fiddled with the different functions. I think a com explorer may expose these objects as well. the old ole/com Object viewer may work as well

jcoroyer
10-10-2006, 07:26 AM
code samples are interesting here... I would like to do the same, but in C++ (Visual C++ 6.0, MFC app). Does anyone know how to implement those events in C++ ?

Thanks
Jerome

grahamchilla
12-12-2006, 01:28 PM
Try using this in your form:

"Application:: DoEvents;"

(I had to put a space before the 'D' ind DoEvents to avoid this happening: Application::DoEvents; but don't include that space)


I think there is better "threading" techniques to use, but this is a quick fix.

K0NFUZIUS
01-11-2012, 09:19 AM
After some problems I found a solution doing this in VB.NET
Here is the solution for VB.NET Users:



Public Sub ISWiRelease_ProgressIncrement(ByVal lIncrement As Long, ByRef pbCancel As Boolean)
' Do something
End Sub

Public Sub ISWiRelease_ProgressMax(ByVal lMax As Long, ByRef pbCancel As Boolean)
' Do something
End Sub

Public Sub ISWiRelease_StatusMessage(ByVal sMessage As String, ByRef pbCancel As Boolean)
' Do something
End Sub

Sub buildSub()
Dim release As ISWiAuto17.ISWiRelease
release = oISM.ISWiProductConfigs("myConfig").ISWiReleases("Compressed(STANDARD)")
AddHandler release .ProgressIncrement, AddressOf Me.ISWiRelease_ProgressIncrement
AddHandler release .ProgressMax, AddressOf Me.ISWiRelease_ProgressMax
AddHandler release .StatusMessage, AddressOf Me.ISWiRelease_StatusMessage
release.Build()
[...]
End Sub


Cheers Joerg