]> Creatis software - crea.git/blobdiff - src/creaSystem.cxx
Add GetDllAppPath(const char *nomdll);
[crea.git] / src / creaSystem.cxx
index 69293a982369586e718dd76c6bfe73a4062a7ea4..32051781a6eb9631bd03f6184324c89b7c214d82 100644 (file)
@@ -180,6 +180,22 @@ std::string System::GetDllAppPath(std::string &nomdll){
        return path;
 }
 
+
+std::string System::GetDllAppPath(const char *nomdll){
+       std::string path = ".";
+#ifdef WIN32
+       char currentPath[_MAX_PATH];
+       HMODULE hand = GetModuleHandle(nomdll);
+       GetModuleFileName(hand, currentPath, _MAX_PATH);
+
+       path = currentPath;
+
+       path = path.substr(0,path.find_last_of("\\"));
+#endif
+       return path;
+}
+
+
 #if defined(_WIN32)
 #define CREACONTOUR_VALID_FILE_SEPARATOR_CHAR '\\'
 #else