std::string getCurModuleDir()
{
enum {BUF_LEN =1024};
char pcDirection[BUF_LEN];
memset(pcDirection,0,sizeof(pcDirection));
#if defined(WIN32)
GetModuleFileNameA(NULL,pcDirection,BUF_LEN);
#else
readlink("/proc/self/exe",pcDirection,BUF_LEN);
#endif
for(int i=(int)strlen(pcDirection);i>=0;i--)
{
#if defined(WIN32)
if(pcDirection[i]=='\\')
#else
if(pcDirection[i]=='/')
#endif
{
pcDirection[i+1] ='\0';
}
return pcDirection;
}