比如在链接时会出现一大堆warning LNK4099,在代码中写
1 | #pragma warning(disable:4099) |
是无法禁止这些警告的,正确方法是在项目属性Properties->Linker->Command Line中添加
1 | /ignore:4099 |
人,技术,生活。
比如在链接时会出现一大堆warning LNK4099,在代码中写
1 | #pragma warning(disable:4099) |
是无法禁止这些警告的,正确方法是在项目属性Properties->Linker->Command Line中添加
1 | /ignore:4099 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | int pathGetContainer(const char *path, string &dir) { const char *p; for (p = path + strlen(path); p >= path; p--) { if (*p == '/' || *p == '\\') break; } dir = string(path).substr(0, p - path + 1); return 1; } ... char curPath[1024]; GetModuleFileNameA(AfxGetApp()->m_hInstance, curPath, sizeof(curPath)); string curDir; pathGetContainer(curPath, curDir); SetCurrentDirectoryA(curDir.c_str()); ... |