设置当前工作目录为模块所在路径
This commit is contained in:
parent
7316c326d0
commit
ab25935685
@ -63,6 +63,11 @@ int main(int argc, char **) {
|
|||||||
std::string filterComName;
|
std::string filterComName;
|
||||||
std::string inputCommands;
|
std::string inputCommands;
|
||||||
std::stringstream oss;
|
std::stringstream oss;
|
||||||
|
char path_buffer[MAX_PATH + 1];
|
||||||
|
GetModuleFileName(nullptr, path_buffer, MAX_PATH);
|
||||||
|
(strrchr(path_buffer, '\\'))[0] = 0;
|
||||||
|
std::string path = path_buffer;
|
||||||
|
filesystem::current_path(path);
|
||||||
if (filesystem::exists("./config.toml")) {
|
if (filesystem::exists("./config.toml")) {
|
||||||
const auto config = toml::parse("./config.toml");
|
const auto config = toml::parse("./config.toml");
|
||||||
filterComName = config.at("ComPorts").as_string();
|
filterComName = config.at("ComPorts").as_string();
|
||||||
|
Loading…
Reference in New Issue
Block a user