TCHAR tszExePath[MAX_PATH] = {0}; //定义一个字符数组
GetModuleFileName(NULL, tszExePath, MAX_PATH); //给字符数组赋值
wstring wsTemp = tszExePath; // 用字符数组的地址初始化wstring 变量.
wstring wsPath = wsTemp.substr(0, wsTemp.find_last_of(L"//") + 1); // 使用wstring的封装函数.
wcscpy(m_tszCurrentDir, wsPath.c_str()); // 使用wstring的数据.
GetModuleFileName(NULL, tszExePath, MAX_PATH); //给字符数组赋值
wstring wsTemp = tszExePath; // 用字符数组的地址初始化wstring 变量.
wstring wsPath = wsTemp.substr(0, wsTemp.find_last_of(L"//") + 1); // 使用wstring的封装函数.
wcscpy(m_tszCurrentDir, wsPath.c_str()); // 使用wstring的数据.