Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CNiReal64Matrix undefined

Yes - I'm new to Meas.Std.  I have created project using VS2003 C++ (not Meas Studio proj).  I have successfully added NI plotting functions and they work fine.  Then tried to add CWGraph3d.  This worked and compiled okay. BUT then tried to add a "CNiReal64Matrix* myMatrix;" and it is not found/defined.  Started to get errors:

d:\AOSystem\AOBase2\AO_Support\Utilities\src\SysMatrixUI\xDisplay3DImage.h(25) : error C2501: 'SysMatrixUI::xDisplay3DImage::CNiReal64Matrix' : missing storage-class or type specifiers

d:\AOSystem\AOBase2\AO_Support\Utilities\src\SysMatrixUI\xDisplay3DImage.h(25) : error C2501: 'SysMatrixUI::xDisplay3DImage::myDMatrix' : missing storage-class or type specifiers

---------------

I tried changed declaration to : "NI::CNiReal64Matrix* myMatrix;"   but then NI is not a name space

Tried to add that as well "using namespace NI;" to no avail.

-------------

I went back and tried to add class wizards using menu item "measurement Studio"->"Add/Remove class wizards, to add the 3D call.  Then I started to get errors like:

d:\Program Files\National Instruments\MeasurementStudioVS2003\VCNET\Include\NiColor.h(87) : error C2143: syntax error : missing ';' before '&'

d:\Program Files\National Instruments\MeasurementStudioVS2003\VCNET\Include\NiColor.h(87) : error C2433: 'NI::CArchive' : 'friend' not permitted on data declarations

------------------

What am I doing wrong???

0 Kudos
Message 1 of 3
(5,874 Views)
Hi stvnjns,

I am currently looking into what resources need to be included in your project to reference this class. Since creating a Measurement Studio project resolves the issue, we need to find the differences between this and a basic project.

Thank you for your patience!
0 Kudos
Message 2 of 3
(5,849 Views)
Hi stvnjns,

Measurement Studio includes native C++ data types such as CNiReal64Matrix and CNiReal64Vector (many other data types as well).  In order for Visual Studio to recognize these data types, you need to either create a Measurement Studio C++ application (which will initially add the native Measurement Studio classes) or use the Measurement Studio Add/Remove Class Libraries Wizard (add classes to existing MFC projects).  If you do not add the Measurement Studio classes to your MFC project, Visual Studio will not recognize these native Measurement Studio C++ data types and display errors. 

Since it appears you will be using our user interface controls as well, make sure to add the appropriate Measurement Studio user interface classes (either by using the Class Libraries Wizard or by creating a Measurement Studio project from scratch) to your MFC project.

When you drop an ActiveX control onto a MFC form, a wizard generates wrapper classes that allow you to communicate with the control.  We have created custom wrappers for our Measurement Studio ActiveX controls. So, if you don't add the Measurement Studio classes to your project, Visual Studio will not use those custom wrappers. Instead, Visual Studio will generate its own wrappers for our control.  Our wrapper is preferred
over the auto-generated MFC wrapper for a variety of reasons. For example, the custom wrapper allows you to call the control from any thread, and the custom wrapper automatically translates from ActiveX data types to Measurement Studio native C++ data types such as CNiReal64Vector.

Refer to the Adding Measurement Studio Controls to an MFC Project in Microsoft Visual C++ and Loading Measurement Studio ActiveX Controls into Visual C++ 6.0 KnowledgeBases for more in depth information. 

Honestly, since your are just starting out with Measurement Studio, I would create a Measurement Studio C++ project from scratch with all the included classes. This way you will start off in the right direction without any conflicts. 

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 3 of 3
(5,847 Views)