由于win10比较特殊,导致获取的文件路径是错误的,用下面代码就可以解决
char path[200];
memset(path, 0x00, sizeof(path));
GetModuleFileNameA(_hdllInstance, path, 200);//get work path,_hdllInstance为当前路径,也可以指定文件名
string workPath = path;
size_t position = workPath.find_last_of("\\");//find last
memset(path, 0x00, strlen(path));
memcpy(path, workPath.c_str(), position);
strcat_s(path, "\\Config.ini");
char outdata[200];
memset(outdata, 0x00, sizeof(outdata));

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
相关资源
相似解决方案