Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 13, 2006

Embedding a Dynamically Created Licensed Measurement Studio ActiveX Control in a Visual C++ Dialog Window

0 ratings | 0.00 out of 5
Print

Downloads

Filename: dynamic_control_vc.zip
Requirements: View

Filename: licenseutility.zip
Requirements: View

This example demonstrates how to dynamically create a Measurement Studio CNiGraph control and add the appropriate license string for the control to prevent it from running in evaluation mode.

You can dynamically create licensed Measurement Studio controls in Microsoft Visual C++. To prevent controls from running in evaluation mode, you must include a run-time license string in the source code to create the control when the program is executed. You can use the Microsoft License Key Request Utility to create the run-time license string from the control development license. When you run this utility, it returns the appropriate run-time license string for any registered control you select.

To create one of the Measurement Studio ActiveX controls at run-time, use one of the following functions: Create(...) or CreateControl(....). These functions are available for all Visual C++ ActiveX controls that ship with Measurement Studio. You pass the license key data to these functions as a string parameter. The license key data is necessary for creating any control that requires a run-time license key. If this license key is missing, the control is created in evaluation mode.

Complete the following steps to use this example program:
1. Unzip DynamicControl_VC.zip.
2. Compile and run the dynamicControl project.The CWGraph control runs in evaluation mode.
3. Unzip the LicenseUtility.zip file and compile the project with Visual C++ 6.0 or later.
4. Run LICREQST.exe and select CWUIControlsLib.CWGraph.1.
5. In License Key Data for Currently Selected Control, select and copy the text inside the curly brackets.
6. In the dynamicControl project, paste the data you copied, which is the license string, between the curly brackets for WCHAR pwchUILic[].
The OnButton1 function contains code that converts the license string from a WCHAR to BSTR so you can use it in the CNiGraph::Create function.
7. Compile and run the dynamicControl project.The CWGraph control no longer runs in evaluation mode.

IMPORTANT INFORMATION:
- You must modify the license string provided in the dynamicControl example. It is not an actual license and will not work.
- You cannot distribute source code that includes Measurement Studio run-time licenses to anyone who does not own an equivalent Measurement Studio development license.
- LICRQST.EXE is a Microsoft file and is redistributed according to the license agreement, legal.txt, which is included in the LicenseUtility.zip file.

Requirements


Filename: dynamic_control_vc.zip

Software Requirements


Application Software: Measurement Studio Visual C++ Support 6.0
Language(s): Visual C++
Additional Software: Visual C++

 
Filename: licenseutility.zip

Software Requirements


Application Software: Measurement Studio Visual C++ Support 6.0
Language(s): Visual C++
Additional Software: Visual C++ 6.0

 
0 ratings | 0.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).