NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i add paths to C++ to use Teststand

I am still trying to learn how to develop dlls in C++ for Teststand. I looked into the examples but when i tried to compile, i am getting errors on not recognizing the header file. Can I know what i should add in the paths or environment var? Thank you!

0 Kudos
Message 1 of 10
(4,414 Views)

If you are using visual studio, then TestStand should be adding the paths for you automatically whenever you launch teststand or use the version selector program. What C++ environment are you using?

 

-Doug

0 Kudos
Message 2 of 10
(4,392 Views)

I am using Microsoft Visual C++ 2010 Express....and I am still getting the errors...

0 Kudos
Message 3 of 10
(4,384 Views)

What version of TestStand are you using?

0 Kudos
Message 4 of 10
(4,363 Views)

TestStand 2010

0 Kudos
Message 5 of 10
(4,356 Views)

If you view the project properties dialog for your C++ project (right-click on the project, choose properties), is there an item at the end of the list on the left called "NI TestStand"?  It should look like the attached screenshot.  I know that in VS 2010 it should work, but I can't speak specifically to VS 2010 Express.

 

-Jeff

0 Kudos
Message 6 of 10
(4,351 Views)

I checked and I do not have the NI TestStand....maybe that is the reason why i am getting the compilation error. Can I know how I can add that to it? Thank you!

0 Kudos
Message 7 of 10
(4,346 Views)

I would try running version selector (just click Make Active with TS 2010 selected) and then launching TestStand as the same user that is using VS.  If you have done that then it should be there.  Please let me know if you do this and they still do not show up and I'll have to do some investigating with VS 2010 Express to see if I see the same behavior you are seeing.

 

In the mean time, if you just want to be able to build you can add the following to your Project Properties » VC++ Directories » Include Directories:

$(TestStand)\Bin;$(TestStand)\API\VC;$(TestStand)\API\DLLInterfaces

 

If Visual Studio is not recognizing the $(TestStand) macro then you will have to fill that in with the full path to those corresponding TS directories on your machine.

 

-Jeff

0 Kudos
Message 8 of 10
(4,345 Views)

After using the selector, it seems to recognize the header files but am still getting error.

 

a) The error message is as below. I was trying to compile FileTab.cpp

 

1>c:\users\public\documents\national instruments\teststand 2010\userinterfaces\full-featured\c++ using mfc\stdafx.h(33): fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

 

 

b) Not sure if this can still be the problem. I look into the Properties and still could not see the TestStand there

 

 

 

 

0 Kudos
Message 9 of 10
(4,338 Views)

I think the error you are seeing is because it is an MFC project and it looks like VS 2010 Express does not support MFC:
http://msdn.microsoft.com/en-us/library/hs24szh9.aspx

 

The TS include directories are getting pulled in even though you don't see the option to enable/disable them on the project properties dialog (that seems to be a separate issue that I will have to look into further).

 

From the path in your error message it looks like you are trying to build the MFC User Interface.  If you are looking to get familiar with making C++ Dll's for use with TS you will probably want to look instead at our examples (for instance: <TestStand 2010>\Examples\AccessingPropertiesUsingAPI\UsingMFC).  Although you will need to upgrade to at least Visual Studio Professional to build the MFC Dll's there as well.

 

-Jeff

 

0 Kudos
Message 10 of 10
(4,300 Views)