可以应用函数GetModuleFileName(),举一个例子:

CString strexe;
::GetModuleFileName(NULL,strexe.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
int nexe = strexe.GetLength();
for(i=nexe-1;i>=0;i--)
{
       if(strexe[i]=='\\')
       break;
}
strtmp = strexe.Left(i+1);

strtmp存储的就是exe文件所在的目录,而strexe会包含文件名

相关文章:

  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2021-12-20
  • 2021-11-06
猜你喜欢
  • 2022-02-12
  • 2021-12-04
  • 2021-10-08
  • 2021-10-27
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
相关资源
相似解决方案