Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Could not declare a CNiTimer variable in a *view.h header file

Solved!
Go to solution

Could not declare a CNiTimer variable in a *view.h header file?

 

I launch a MDI VC2005 project with NI measurement studio extention. I check out the "TemperatureSystemSDI.2005" example project. It works very well.

But when I use the following declarations in *view.h, compile errors are reported:

 

Code:

class CVAView : public CFormView
{...

public:
    CNiTimer* m_pTimer;

...

}

 

Error:

C2143, C4430.

 

At the first beginning, I guess the error may occure when lacking of header file include. But when I include the following headers, there still exist compile errors.

 

Code:

#include "NiGraph.h"
#include "NiSlide.h"
#include "NiTimer.h"

 

This time the compile errors are:

C2440,C2548, C2143, C4430, even more than the case of not including these headers.

 

I don't know what's wrong. I just declare a CNiTimer varible! Would you plz help me .

 

 

 

 

 

 

0 Kudos
Message 1 of 2
(6,837 Views)
Solution
Accepted by topic author yinyz2008

Either add #include "NiUtilityComponent.h" or use the Measurement Studio Add/Remove Class Library wizard (in the Measurement Studio menu inside Visual Studio) to add a reference to the Utility class library. The *Component.h files aggregate all of the necessary header and library includes for a particular Measurement Studio C++ library.

 

If this doesn't work, please attach your project and we'll take a look at it.

 

David Rohacek

National Instruments

Message 2 of 2
(6,829 Views)