National Instruments 320682C Musical Toy Instrument User Manual


 
Utility Library Chapter 8
LabWindows/CVI Standard Libraries 8-34 © National Instruments Corporation
GetProjectDir
int
result
=
GetProjectDir
(
char
directoryName
[]
);
Purpose
Gets the name of the directory containing the currently loaded project file.
Parameters
Output
directoryName
string Directory of project.
Return value
result
integer Result of operation.
Return codes
0
-1
Success.
Current project has no pathname (it is untitled).
Parameter Discussion
directoryName
must be at least MAX_PATHNAME_LEN bytes long.
Using This Function
This function is useful when a project and its related files are distributed to multiple users who
may place them in a different directory on each machine. If your program needs to access a file
that is in the same directory as the project, you can use GetProjectDir and
MakePathname to construct the full pathname.
Example
char *fileName;
char projectDir[MAX_PATHNAME_LEN];
char fullPath[MAX_PATHNAME_LEN];
fileName = "myfile";
if (GetProjectDir (projectDir) < 0)
FmtOut ("Project is untitled\n");
else
MakePathname (projectDir, fileName, fullPath);