Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How to instantiate a CW control at run time.

I am trying to dynamically create CW controls. I've followed the VB example posted on here. It fails because I need to add a License. I understand why, but how? Now, I would like to take your CW slider, and a text box, and put them into my own active x to be used to control an analog channel to control a motor's speed. Will there be issues like this concerning that active X as well? Also, is there a performance hit associated with dynamically created your controls?
0 Kudos
Message 1 of 2
(3,425 Views)
To work around the license issue, see the Microsoft Knowledge Base article LICREQST.EXE Requesting a License Key from an Object and download licreqst.exe. Run licreqst.exe and find "CWUIControlsLib.CWSlide.1" under the registered controls section and click on it. The license string at the top can be passed to Licenses.Add and then you should be able to dynamically create the Measurement Studio controls. For example:

Private Sub Form_Load()
Licenses.Add "CWUIControlsLib.CWSlide.1", "[Add license string from licreqst here]"

Dim slide
Set slide = Controls.Add("CWUIControlsLib.CWSlide.1", "slide")

With slide
.Top = 120
.Width = 1215

.Visible = True
End With
End Sub

Creating controls like this would have an impact on performance since all calls are late bound. If you are using the Measurement Studio controls in a UserControl, though, you should not need to do this since the license would get compiled into the binary that contains the control. I don't think that you would have any problems creating your control since it would not be licensed.

- Elton
Message 2 of 2
(3,425 Views)