Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

What is preferred way to check, from C++ source code level, if Measurement Studio OCX controls are already installed on target machine?

I want to inform user if Measurement Studio OCX constrols are not installed on his machine. How to check it from C++ source code level? Is any prefered way?
Jaroslaw
0 Kudos
Message 1 of 6
(4,491 Views)
If you have Measurement Studio installed on your computer, you will see MStudio controls in the Visual Studio toolbox menu on the left side of your Visual Studio Environment screen.  There will be two tabs in this menu bar, one for C++ and another for Visual Basic/C#.    If you right click anywhere in the C++ tab, you can see various C++ controls that can be added for use.  You will see the .NET Framework Components and the COM Components. If you sort by Assembly space or library, you can see the National Instruments components.
 
Thank you
Nandini
NI
0 Kudos
Message 2 of 6
(4,460 Views)

You did not understand my problem, I'm afraid. I know how o do it by myself of course.

My goal is deliver application (written in C++) which will inform the user if MStudio controls are not available on target machine.  I'll be gratefull for small example in C++.

 

Regards

Jarek

0 Kudos
Message 3 of 6
(4,451 Views)
Jarek:

If you do have Measurement Studio on your computer, you will see that the cwui.ocx file is present in the C:\WINDOWS\SYSTEM32 folder. You can check if the file is registered on the target computer. All registered dll/ocx files can be viewed using an windows function. You can see the code provided in the link below.

http://www.codeguru.com/cpp/com-tech/activex/controls/article.php/c5527/

Alternatively, you can try opening the cwui.ocx file using functions such as the following:

ofstream myfile;
myfile.open ("cwui.ocx");


If the function opens the file, then it means that it exists and was registered on your computer correctly. If the function returns a -1, it means the file was not found.

Thank you
Nandini
NI
0 Kudos
Message 4 of 6
(4,423 Views)

Thanks o lot.

I'm checking the registered controls. Control name is in the following format:

CWXX Control (National Intruments)

I assume that also in the future CWXX (CWButton,CWSlide,...) strings will the part of control names.

Regards

Jaroslaw

 

0 Kudos
Message 5 of 6
(4,401 Views)
I'm not sure if this is exactly what you are asking, but you can certainly rely on the fact that control names CWGraph, CWButton, CWSlide, CWKnob, CWNumEdit, and CWGraph3D will not change.
0 Kudos
Message 6 of 6
(4,395 Views)