11-15-2009 04:14 PM
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
Solved! Go to Solution.
11-16-2009 05:16 PM
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.
11-16-2009 05:22 PM
I'll do that.
thanks!