char buffer[MAX_PATH];GetModuleFileNameA(NULL, buffer, MAX_PATH );string::size_type pos = string( buffer ).find_last_of( \\/ );string currentPath = string(buffer).substr( 0, pos);CHAR fullPath[MAX_P...

char buffer[MAX_PATH]; GetModuleFileNameA(NULL, buffer, MAX_PATH ); string::size_type pos = string( buffer ).find_last_of( "\\/" ); string currentPath = string(buffer).substr( 0, pos); CHAR fullPath[MAX_PATH]; sprintf(fullPath ,"%s\\%s" ,currentPath.c_str() ,"Demo.exe");
织梦狗教程
本文标题为:c++获取当前进程所在位置


基础教程推荐
猜你喜欢
- centos 7 vscode cmake 编译c++工程 2023-09-17
- C语言 详解字符串基础 2023-03-27
- 带你深度走入C语言取整以及4种函数 2022-09-17
- C++实现ETW进行进程变动监控详解 2023-05-15
- C语言编程C++旋转字符操作串示例详解 2022-11-20
- [C语言]二叉搜索树 2023-09-07
- C语言实现宾馆管理系统课程设计 2023-03-13
- C++实战之二进制数据处理与封装 2023-05-29
- 全面了解C语言 static 关键字 2023-03-26
- [c语言-函数]不定量参数 2023-09-08