]> Creatis software - crea.git/blobdiff - src/creaSystem.cxx
*** empty log message ***
[crea.git] / src / creaSystem.cxx
index 65311afe1e6c9601276b7963c26fbf07065a5883..7225884dd445252b2f44d9c45a0727eb4a4c24ed 100644 (file)
@@ -43,12 +43,9 @@ namespace crea
      return isatty(fileno(stdin));
    }
 #endif
-std::string System::GetDllAppPath(std::string nom){
-       std::string path = ".";
-#ifdef WIN32
-#endif
-       return path;
-}
+
+
+
 int System::GetAppPath(char *pname, size_t pathsize)
    {
 #ifdef LINUX   
@@ -172,5 +169,18 @@ int System::GetAppPath(char *pname, size_t pathsize)
 } 
 
 
+std::string System::GetDllAppPath(std::string nomdll){
+       std::string path = ".";
+#ifdef WIN32
+       char currentPath[_MAX_PATH];
+       HMODULE hand = GetModuleHandle(nomdll.c_str());
+       GetModuleFileName(hand, currentPath, _MAX_PATH);
+
+       path = currentPath;
+
+       path = path.substr(0,path.find_last_of("\\"));
+#endif
+       return path;
+}
 
 } // namespace crea