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
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
/// 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