我在在EVC下调用GetWindowsDirectory()函数为什么为什么会产生如下两个错误:
G:\VCproject\Test00\Test00Dlg.cpp(67) : error C2039: 'GetCurrentDirectory' : is not a member of '`global namespace''
G:\VCproject\Test00\Test00Dlg.cpp(67) : error C2065: 'GetCurrentDirectory' : undeclared identifier
呵呵,月经贴了。
WIN CE不支持GetCurrentDirectory,
如果要获取当前路径信息,只能通过GetModuleFileName来获取。
This function gets a module file name.
WINAPI DWORD GetModuleFileName(
HMODULE hModule,
LPWSTR lpFilename,
DWORD nSize
);
Parameters
hModule
[in] Handle to the module whose executable file name is being requested.
If this parameter is NULL, GetModuleFileName returns the path for the file used to create the calling process.
lpFilename
[out] Pointer to a buffer that is filled in with the path and file name of the module.
nSize
[in] Specifies the length, in characters, of the lpFilename buffer.
If the length of the path and file name exceeds this limit, the string is truncated.
Return Values
The length, in characters, of the string copied to the buffer indicates success.
Zero indicates failure.
To get extended error information, call GetLastError.
详情回复
发表于 2009-6-5 13:51
WINAPI DWORD GetModuleFileName(
HMODULE hModule,
LPWSTR lpFilename,
DWORD nSize
);
Parameters
hModule
[in] Handle to the module whose executable file name is being requested.
If this parameter is NULL, GetModuleFileName returns the path for the file used to create the calling process.
lpFilename
[out] Pointer to a buffer that is filled in with the path and file name of the module.
nSize
[in] Specifies the length, in characters, of the lpFilename buffer.
If the length of the path and file name exceeds this limit, the string is truncated.
Return Values
The length, in characters, of the string copied to the buffer indicates success.
Zero indicates failure.
To get extended error information, call GetLastError.