c++获取当前进程所在位置

WCHAR buffer[MAX_PATH];
    GetModuleFileName(NULL, buffer, MAX_PATH );
    wstring::size_type pos = wstring(buffer).find_last_of(TEXT("\\/"));
    WCHAR currentPath[MAX_PATH]=TEXT("");
    lstrcat(currentPath, wstring(buffer).substr(0, pos).c_str());

 

posted on 2019-12-20 10:44  空明流光  阅读(921)  评论(0编辑  收藏  举报

导航