Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. std::string MUtility::GetExecutableDirectoryPath() // TODODB: Implement support for linux platform
  2. {
  3.     std::string returnPath = "FAILED TO FIND EXECUTABLE PATH";
  4. #if PLATFORM != PLATFORM_WINDOWS
  5.         return "Executable path is only available on the windows platform";
  6. #else
  7.         char path[EXECUTABLE_PATH_MAX_LENGTH];
  8.         GetModuleFileName(NULL, path, EXECUTABLE_PATH_MAX_LENGTH);
  9.         PathRemoveFileSpec(path);
  10.         returnPath = path;
  11.         std::replace(returnPath.begin(), returnPath.end(), '\\', '/');
  12. #endif
  13.  
  14.         return returnPath;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement