Path to Application's Directory
Path to Application's Directory
(OP)
Is there an API call that will return the path to the directory the application is located at?
MSDN says GetCurrentDirectory should work, but when I tried using the example code for it, my compiler spit back errors at me saying the "#using <mscorlib.dll>" was an undefined preprocessor directive.
Here's the site where I found that function
h ttp://msdn .microsoft .com/libra ry/default .asp?url=/ library/en -us/cpref/ html/frlrf systemiodi rectorycla ssgetcurre ntdirector ytopic.asp
let me know how to fix this, or if there's another way...
MSDN says GetCurrentDirectory should work, but when I tried using the example code for it, my compiler spit back errors at me saying the "#using <mscorlib.dll>" was an undefined preprocessor directive.
Here's the site where I found that function
h
let me know how to fix this, or if there's another way...
RE: Path to Application's Directory
That helpfile was for .net code (C#, managed C++, Visual Basic .net, etc)
Chip H.
____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
RE: Path to Application's Directory
RE: Path to Application's Directory
char work[MAX_PATH+1];
GetModuleFileNameEx(GetCurrentProcess(),
NULL,
work,
sizeof(work));
Another option in C/C++:
#include <stdlib.h>
char caProg[MAX_PATH+1];
strcpy(caProg, _pgmptr);