Use wxString::t_str(), not fn_str(), with Windows API functions.
fn_str() is supposed to be used with the CRT functions taking file names only, not Windows API functions that always take LPCTSTR with all compilers/CRT versions. Closes #14433. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1537,7 +1537,7 @@ bool wxSetWorkingDirectory(const wxString& d)
|
|||||||
// No equivalent in WinCE
|
// No equivalent in WinCE
|
||||||
wxUnusedVar(d);
|
wxUnusedVar(d);
|
||||||
#else
|
#else
|
||||||
success = (SetCurrentDirectory(d.fn_str()) != 0);
|
success = (SetCurrentDirectory(d.t_str()) != 0);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
// Must change drive, too.
|
// Must change drive, too.
|
||||||
@@ -1765,7 +1765,7 @@ static bool wxCheckWin32Permission(const wxString& path, DWORD access)
|
|||||||
// quoting the MSDN: "To obtain a handle to a directory, call the
|
// quoting the MSDN: "To obtain a handle to a directory, call the
|
||||||
// CreateFile function with the FILE_FLAG_BACKUP_SEMANTICS flag", but this
|
// CreateFile function with the FILE_FLAG_BACKUP_SEMANTICS flag", but this
|
||||||
// doesn't work under Win9x/ME but then it's not needed there anyhow
|
// doesn't work under Win9x/ME but then it's not needed there anyhow
|
||||||
const DWORD dwAttr = ::GetFileAttributes(path.fn_str());
|
const DWORD dwAttr = ::GetFileAttributes(path.t_str());
|
||||||
if ( dwAttr == INVALID_FILE_ATTRIBUTES )
|
if ( dwAttr == INVALID_FILE_ATTRIBUTES )
|
||||||
{
|
{
|
||||||
// file probably doesn't exist at all
|
// file probably doesn't exist at all
|
||||||
|
@@ -812,7 +812,7 @@ static int wxOpenWithDeleteOnClose(const wxString& filename)
|
|||||||
DWORD attributes = FILE_ATTRIBUTE_TEMPORARY |
|
DWORD attributes = FILE_ATTRIBUTE_TEMPORARY |
|
||||||
FILE_FLAG_DELETE_ON_CLOSE;
|
FILE_FLAG_DELETE_ON_CLOSE;
|
||||||
|
|
||||||
HANDLE h = ::CreateFile(filename.fn_str(), access, 0, NULL,
|
HANDLE h = ::CreateFile(filename.t_str(), access, 0, NULL,
|
||||||
disposition, attributes, NULL);
|
disposition, attributes, NULL);
|
||||||
|
|
||||||
return wxOpenOSFHandle(h, wxO_BINARY);
|
return wxOpenOSFHandle(h, wxO_BINARY);
|
||||||
@@ -1318,11 +1318,7 @@ bool wxFileName::Rmdir(const wxString& dir, int flags)
|
|||||||
SHFILEOPSTRUCT fileop;
|
SHFILEOPSTRUCT fileop;
|
||||||
wxZeroMemory(fileop);
|
wxZeroMemory(fileop);
|
||||||
fileop.wFunc = FO_DELETE;
|
fileop.wFunc = FO_DELETE;
|
||||||
#if defined(__CYGWIN__) && defined(wxUSE_UNICODE)
|
fileop.pFrom = path.t_str();
|
||||||
fileop.pFrom = path.wc_str();
|
|
||||||
#else
|
|
||||||
fileop.pFrom = path.fn_str();
|
|
||||||
#endif
|
|
||||||
fileop.fFlags = FOF_SILENT | FOF_NOCONFIRMATION;
|
fileop.fFlags = FOF_SILENT | FOF_NOCONFIRMATION;
|
||||||
#ifndef __WXWINCE__
|
#ifndef __WXWINCE__
|
||||||
// FOF_NOERRORUI is not defined in WinCE
|
// FOF_NOERRORUI is not defined in WinCE
|
||||||
|
Reference in New Issue
Block a user