0

As far as I understand _wgetcwd returns pointer to string(wchar_t*) to application directory(directory from exe is).

When I run Visual Studio(2012) debug _wgetcwd returns project directory not the one that contains executed exe file.

Is it expected? Is there any other prefered method that returns directory containing ran executable?

4

2 回答 2

2

不,它不返回程序所在的目录,它返回进程的当前工作目录,在某些情况下可能与程序所在的位置相同。

您可以更改项目设置以设置工作目录。

于 2013-10-02T18:11:37.573 回答
0

You can use GetModuleFileName.

于 2013-10-02T18:18:17.003 回答