if (DWORD len = GetModuleFileName(NULL, exe_path, sizeof(exe_path)/sizeof(exe_path)))
// removing the filename of the exe, leaving there just the directory part...
while (len>0 && exe_path[len-1]!='\\')
exe_path[len] = 0;
// now exe_path holds the directory that contains the exe file with a trailing backslash
// blah blah blah
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)