NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand / CVI conflict : Project Directory

Solved!
Go to solution

Hello,

 

I have TestStand 4.2, LabWindows/CVI 8.5, Windows XP.   I'm testing a DLL created in CVI, which uses the "GetProjectDir()" to establish a base path to work in.  

 

when this DLL is exercised by a C program, it detects the project directory, C:\sandbox, which the program is executed from.

 

however, when i run TestStand out of the same project directory (C:\sandbox) it instead detects the project directory as being C:\Program Files\National Instruments\TestStand 4.2\Bin\

 

this is obviously not an acceptable path to build and work with temporary directories and files.

 

this continues to happen even though i've created and launched the Sequence File from the "correect" directory (C:\sandbox) 

 

How can I make testStand agree with CVI on what the project  directory is?

 

Thanks

 

 

 

0 Kudos
Message 1 of 3
(3,368 Views)
Solution
Accepted by topic author rjohnson

Hi rjohnson,

 

The reason that you are seeing this behavior is that the GetProjectDir function obtains the directory containing the executable file, so when we run the DLL from TestStand, it captures where TestStand is run from.  You can instead use the GetModuleDir function:

 

char path[MAX_PATHNAME_LEN];
GetModuleDir(__CVIUserHInst,path);

 

This should give you the desired path.

Cheers,
Kelly R.
Applications Engineer
National Instruments
Message 2 of 3
(3,342 Views)

I'll do that.

 

thanks!  

0 Kudos
Message 3 of 3
(3,338 Views)