From: Juan Prieto Date: Tue, 15 Sep 2009 11:32:40 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: EED.02Oct2009~6 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a92a4d8ae0373b7e45cba62c8f84c2196030a269;p=crea.git *** empty log message *** --- diff --git a/src/creaSystem.cxx b/src/creaSystem.cxx index 65311af..460bb7f 100644 --- a/src/creaSystem.cxx +++ b/src/creaSystem.cxx @@ -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 diff --git a/src/creaSystem.h b/src/creaSystem.h index 9ca8c93..a64dc7c 100644 --- a/src/creaSystem.h +++ b/src/creaSystem.h @@ -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