DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft Windows Common Controls

I want to include in a script a progress bar.  So I want a new dialog box ( or message or window) to pop up and give current progress status while my main script is running.  Looks like visual basic has "Microsoft Windows Common Controls" which would be able to do this.  How do I access "Microsoft Windows Common Controls" from inside Diadem?  Is there a Diadem example for doing this?

0 Kudos
Message 1 of 11
(5,971 Views)

Because common controls are no available on every machine it might be a good idea to use the DIAdem build in Progress Bar.

 

From DIAdem help:

Dim intLoop
Call LoopInit()
For intLoop= 1 To 100 
  Call LoopInc(intLoop)
  Call Pause(0.1)
Next
Call LoopDeInit()

 

There is also the DIAdem status bar:

Dim Sum, I
Sum = 0
Call MsgLineDisp("Calculation starts")
For I = 1 To 1000
  Sum = Sum + I
  Call MsgLineDisp("Actual value: " & I)
Call Pause(0.1)
 Next Call MsgBoxDisp("Sum of values: " & Sum)
0 Kudos
Message 2 of 11
(5,962 Views)

And there is the ability to use message dialogs that do not stop the script:

Dim Sum, I
Sum = 0
Call MsgLineDisp("Calculation starts")
For I = 1 To 10
  Sum = Sum + I
  Call MsgBoxDisp("Actual value: " & I, "MB_NOBUTTON", "MsgTypeNote",, ,TRUE)
  Call Pause(0.5)
Next
Call MsgBoxDisp("Sum of values: " & Sum, "MB_NOBUTTON", "MsgTypeNote",, 5,TRUE)

 

0 Kudos
Message 3 of 11
(5,959 Views)

Are you saying that the options listed in your first response do actually stop the main script?

0 Kudos
Message 4 of 11
(5,957 Views)

No noe of this options stop the script. They just give status information. But a normal vbs MsgBox would stop the script.

0 Kudos
Message 5 of 11
(5,954 Views)

I am already using MsgLineDisp, but this really doesn't capture what I am trying to do.  I want a progress bar.

 

So, AndreasK did give me information about MsgLineDisp, but one of my main questions was "How do I access "Microsoft Windows Common Controls" from inside Diadem?".  AndreasK stated ""no available on every machine" which I assume means he is concerned whether Microsoft Windows Common Controls is available on every machine. 

 

But, let's assume for a moment that it was "available".  If it were, how do I go about accessing it inside Diadem? 

 

If I were using "Microsoft Word", I would go to the Microsoft Visual Basic portion and click on TOOLS | REFERENCES and select it from the list of checkboxes. 

 

How do I acquire access to these libraries from inside Diadem? 

0 Kudos
Message 6 of 11
(5,926 Views)

Hello, the common controls are available as ActiveX in DIAdem Sud.

They are inserted by Pressing the Button with the red X.

 

Afterwards you can insert

Microsoft ProgressBar Control, version 6.0

 

Use Code like this to show progress where progressbar is the name of the control element inside the SUD dialog.

But still there is an issue. The common controls are not available/licensed on every windows machine.

If there is no MS Office your DIAdem SUD will just contain empty space.

 

Sub start_EventClick(ByRef This) 'Created Event Handler

 dim maxcount : maxCount = 100
  dim i : for i = 1 to maxCount
    Pause 0.1
    progressbar.X.Value = i / maxCount * 100
  Next

End Sub 
0 Kudos
Message 7 of 11
(5,923 Views)

"inside the SUD dialog"? 

 

What is SUD.  Not familiar with this term.

0 Kudos
Message 8 of 11
(5,903 Views)

Hello Colin,

 

SUD = Scriptable User Dialog.

 

You get access to these in DIAdem SCRIPT via this icon:

 

SUD.png

 

Hope that helps,

 

     Otmar

Otmar D. Foehner
0 Kudos
Message 9 of 11
(5,898 Views)

Thanks.  That may prove handy.  I was thinking your answer might be different.  So, let me explain what I expected.  What I thought you would give me is the steps to do what I can do in Microsoft Word.  If I hit ALT-F11, the Microsoft Visual Basic Window opens.  On the menu, I hit Tools|References.  From there, I can see many visual basic libraries.  So, now that you have explained how to use the SUD, can you tell me if there is a way to utilize other visual basic libraries inside Diadem?

0 Kudos
Message 10 of 11
(5,892 Views)