01-10-2011 09:25 AM
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!
01-11-2011 09:24 AM
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
01-11-2011 10:18 AM
I am using Microsoft Visual C++ 2010 Express....and I am still getting the errors...
01-12-2011 09:55 AM
What version of TestStand are you using?
01-12-2011 10:40 AM
TestStand 2010
01-12-2011 11:50 AM
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
01-12-2011 11:53 AM
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!
01-12-2011 11:59 AM
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
01-12-2011 01:39 PM
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
01-13-2011 01:28 PM
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