NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Link error in VC++ 6.0 accessing sequencecontext

I'm trying to access the sequencecontext in my VC++ dll. But when I add the NI default code line

"_bstr_t lastUserName = context->GetValString("StationGlobals.TS.LastUserName", 0);"

I get an link error on this row, error meassege.

"error LNK2001: unresolved external symbol "public: class _bstr_t __thiscall TS::PropertyObject::GetValString(class _bstr_t,long)" (?GetValString@PropertyObject@TS@@QAE?AV_bstr_t@@V3@J@Z)
Debug/dlltest.dll : fatal error LNK1120: 1 unresolved externals"

This code line is created by NI TestStand, why doesn't it work ? Sending GPIB commands to instrument works, etc. The dll is accesseble from TestStand except from the code line above.

Regards
Fredrik
0 Kudos
Message 1 of 3
(3,193 Views)
Solution:

Include the "Teststand\bin" directory correctly in

"Project settings"
"C/C++ preprocessor"
0 Kudos
Message 2 of 3
(3,193 Views)
Hi Fredrik,

You should use the #import directive in your project to include the TS namespace within your current context. With this all of the objects and methods exposed by the TestStand API will be available to you. Basically, you do this with a line like this at the top of your code:

#import "\bin\teapi.dll"

Where is the directory that you installed TestStand too.

Other than this, you might want to explain what you mean when you say that this is "the NI default code line" and that "this code line is created by NI TestStand". Do you mean that you copied this from an example into your source file, or are you just trying to use one of our examples and it won't build properly?

Jason F.
Applications Engineer
National Instrument
s
www.ni.com/ask
0 Kudos
Message 3 of 3
(3,193 Views)