Window下获取执行文件的目录的路径函数

来源:互联网 发布:js数组删除指定的元素 编辑:程序博客网 时间:2024/04/29 17:20
char* DXGetModulePath(char *path, int nLen){    int nRet = GetModuleFileName(NULL, path, nLen);    char *p;        if (0 == nRet)        return NULL;    p = path + nRet;        while (1)    {        if (*p == '\\')        {            p[1] = 0;            break;        }        p--;    }    return path;}

原创粉丝点击