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
Program: crea
Module: $RCSfile: creaSystem.h,v $
Language: C++
- Date: $Date: 2010/04/01 11:05:21 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2010/04/20 12:19:46 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define UINT32_MAX (4294967295U)
#endif
-
-
//-----------------------------------------------------------------------------
{
/// 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 &nomdll);
+ CREA_EXPORT static int GetAppPath(char *pname, size_t pathsize);
+ CREA_EXPORT static std::string GetDllAppPath(std::string &nomdll);
+ CREA_EXPORT static std::string GetDllAppPath(const char *nomdll);
CREA_EXPORT static std::string GetExecutablePath();
-
};
} // namespace crea