From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Time and Dynamically Created Controls

Solved!
Go to solution

I have a project written in VC6 as an MFC Dialog Box project. In a particular box, I dynamically create several (exact number depends on user entry) CNiGraphs. There are also a two CNiButtons that were created at design time using the resource editor. The problem I'm having is that when this dialog box is opened, a message pops up saying it's an eval version and the control will go inactive after 5 minutes. After waiting 5 minutes, the 2 CNiButtons go inactive (turn black), but the CNiGraphs continue to run. I have a valid licensed version of MStudio 8.1.6, but it appears that these 2 buttons don't recognize the license. There are also other design-time buttons in the project but those one's don't have a problem at all. When creating the dynamically creating the CNiGraphs I give them a valid license string, and I was wondering if there is a problem with having design time created and dynamically created controls in the same dialog box. Does anyone know?

 

I can't remember, but I may have created those 2 CNiButtons when I was only using an eval license. (All the other were definitely create when I had a full license) Could that be affecting them? I seem to have a vague recollection of reading somewhere that design-time create controls check the license when they are created in the designer and store that license info in them. If that's the case does anyone know an easy way to update the license stored in the control? I'd rather not just delete it and re-add it as I'd like to avoid having to redo the tab order (unless someone knows how to easily insert something in the middle of the tab order instead of having to click through all the controls in the correct order?)

 

Also, I'm not sure if this would affect anything, but the project was originally built with ComponentWorks 1.0, but we were forced to move to MStudio when we encountered some bugs in CW, so all the controls were originally CW Controls that have been converted to CNi Controls. I doubt this is it though as everywhere else we changed over the controls don't have a problem, but I'm willing to try suggestions.

0 Kudos
Message 1 of 5
(6,123 Views)

Hi JC@GMH,

 

I hope you are doing well today!  Would it be possible for you to upload this code for us to test here?  We would like to see if we can reproduce the behavior you are seeing on our end.  Thanks!  Have a great day!

Taylor G.
Product Support Engineer
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 5
(6,104 Views)

Taylor,

 

Thanks for the reply. I think I may have actually fixed it. I was tinkering with it and decided to add another random unneeded CNiButton. After compiling it with the extra button I ran it and didn't get the eval lisence message. Then I removed the extra control and re-compiled and ran and the message was still gone. I'm guessing that adding that extra CNiButton caused the license that those other 2 were referencing to but updated, but I was wondering you might be able to explain how the CNi controls that are created at design time "store" the licensing information so I can I understand better and feel confident that the message won't reappear later down the road.

 

Thanks for your time!

JC

0 Kudos
Message 3 of 5
(6,100 Views)
Solution
Accepted by topic author JC@GMH

Hi JC,

 

I hope you had a good weekend!  I am glad to hear you are back up and running.  Adding the extra button was, in fact, what caused the updating of the license information for the other buttons, as you suspected.  After doing further research, I have found that the license information is stored wtihin the form for the control, and unless that control changes in any way (or in your case adding a new one to the project), it does not see any reason upon compiling to relink the license.  However, after changing the control and recompiling, it updates the linking of the license information, which resolved this issue in your case.  

 

I hope this helps, JC.  Have a great day!

Taylor G.
Product Support Engineer
National Instruments
www.ni.com/support
0 Kudos
Message 4 of 5
(6,082 Views)

Thanks so much! That's exactly what I needed to know!

0 Kudos
Message 5 of 5
(6,080 Views)