]> Creatis software - crea.git/commitdiff
*** empty log message ***
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 15 Sep 2009 11:32:40 +0000 (11:32 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 15 Sep 2009 11:32:40 +0000 (11:32 +0000)
src/creaSystem.cxx
src/creaSystem.h

index 65311afe1e6c9601276b7963c26fbf07065a5883..460bb7fb53c5756fbb966d11d4f912dc982c9d9e 100644 (file)
@@ -171,6 +171,18 @@ int System::GetAppPath(char *pname, size_t pathsize)
     return -1; /* Path Lookup Failed */
 } 
 
+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
index 9ca8c93d775a3d89b2e4191d30c094e6a728b8aa..a64dc7c642dc5ce73880c3a9fa1f70dcabf821a1 100644 (file)
@@ -3,8 +3,8 @@
   Program:   crea
   Module:    $RCSfile: creaSystem.h,v $
   Language:  C++
-  Date:      $Date: 2009/08/18 01:45:04 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2009/09/15 11:32:40 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -227,7 +227,7 @@ namespace crea
     /// returns true iff the program has a tty
     static int HasTTY(); 
        CREA_EXPORT static int GetAppPath(char *pname, size_t pathsize);
-       CREA_EXPORT static std::string GetDllAppPath(std::string nom);
+       CREA_EXPORT static std::string GetDllAppPath(std::string nomdll);
   };
 
 } // namespace crea