Make wxMSW wxBase compile in UTF-8 mode

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-07-03 20:34:51 +00:00
parent fe048d7736
commit c6867dcd51
7 changed files with 18 additions and 18 deletions

View File

@@ -1851,7 +1851,7 @@ static bool wxCheckWin32Permission(const wxString& path, DWORD access)
HANDLE h = ::CreateFile HANDLE h = ::CreateFile
( (
path.wx_str(), path.c_str(),
access, access,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, NULL,

View File

@@ -183,7 +183,7 @@ IMPLEMENT_LOG_FUNCTION(Status)
void wxSafeShowMessage(const wxString& title, const wxString& text) void wxSafeShowMessage(const wxString& title, const wxString& text)
{ {
#ifdef __WINDOWS__ #ifdef __WINDOWS__
::MessageBox(NULL, text.wx_str(), title.wx_str(), MB_OK | MB_ICONSTOP); ::MessageBox(NULL, text.c_str(), title.c_str(), MB_OK | MB_ICONSTOP);
#else #else
wxFprintf(stderr, wxS("%s: %s\n"), title.c_str(), text.c_str()); wxFprintf(stderr, wxS("%s: %s\n"), title.c_str(), text.c_str());
fflush(stderr); fflush(stderr);

View File

@@ -118,7 +118,7 @@ void wxMessageOutputBest::Output(const wxString& str)
return; return;
} }
::MessageBox(NULL, str.wx_str(), NULL, MB_ICONINFORMATION | MB_OK); ::MessageBox(NULL, str.c_str(), NULL, MB_ICONINFORMATION | MB_OK);
#else // !__WINDOWS__ #else // !__WINDOWS__
// TODO: use the native message box for the other ports too // TODO: use the native message box for the other ports too
wxMessageOutputStderr::Output(str); wxMessageOutputStderr::Output(str);
@@ -159,7 +159,7 @@ void wxMessageOutputDebug::Output(const wxString& str)
wxString out(AppendLineFeedIfNeeded(str)); wxString out(AppendLineFeedIfNeeded(str));
out.Replace(wxT("\t"), wxT(" ")); out.Replace(wxT("\t"), wxT(" "));
out.Replace(wxT("\n"), wxT("\r\n")); out.Replace(wxT("\n"), wxT("\r\n"));
::OutputDebugString(out.wx_str()); ::OutputDebugString(out.c_str());
#else #else
// TODO: use native debug output function for the other ports too // TODO: use native debug output function for the other ports too
wxMessageOutputStderr::Output(str); wxMessageOutputStderr::Output(str);

View File

@@ -194,7 +194,7 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const
wxString ver; wxString ver;
if ( m_dll.IsLoaded() ) if ( m_dll.IsLoaded() )
{ {
wxChar *pc = wx_const_cast(wxChar *, filename.wx_str()); wxChar *pc = wx_const_cast(wxChar *, (const wxChar*) filename.c_str());
DWORD dummy; DWORD dummy;
DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy); DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy);
@@ -281,7 +281,7 @@ wxDllType wxDynamicLibrary::GetProgramHandle()
wxDllType wxDllType
wxDynamicLibrary::RawLoad(const wxString& libname, int WXUNUSED(flags)) wxDynamicLibrary::RawLoad(const wxString& libname, int WXUNUSED(flags))
{ {
return ::LoadLibrary(libname.wx_str()); return ::LoadLibrary(libname.c_str());
} }
/* static */ /* static */

View File

@@ -385,7 +385,7 @@ bool wxRegKey::Open(AccessMode mode)
m_dwLastError = ::RegOpenKeyEx m_dwLastError = ::RegOpenKeyEx
( (
(HKEY) m_hRootKey, (HKEY) m_hRootKey,
m_strKey.wx_str(), m_strKey.wc_str(),
RESERVED, RESERVED,
mode == Read ? KEY_READ : KEY_ALL_ACCESS, mode == Read ? KEY_READ : KEY_ALL_ACCESS,
&tmpKey &tmpKey
@@ -426,7 +426,7 @@ bool wxRegKey::Create(bool bOkIfExists)
&tmpKey, &tmpKey,
&disposition); &disposition);
#else #else
m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey.wx_str(), &tmpKey); m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey.c_str(), &tmpKey);
#endif #endif
if ( m_dwLastError != ERROR_SUCCESS ) { if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"), wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"),
@@ -698,7 +698,7 @@ bool wxRegKey::DeleteSelf()
// now delete this key itself // now delete this key itself
Close(); Close();
m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.wx_str()); m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.c_str());
// deleting a key which doesn't exist is not considered an error // deleting a key which doesn't exist is not considered an error
if ( m_dwLastError != ERROR_SUCCESS && if ( m_dwLastError != ERROR_SUCCESS &&
m_dwLastError != ERROR_FILE_NOT_FOUND ) { m_dwLastError != ERROR_FILE_NOT_FOUND ) {
@@ -942,12 +942,12 @@ bool wxRegKey::QueryValue(const wxString& szValue,
#ifndef __WXWINCE__ #ifndef __WXWINCE__
if ( (dwType == REG_EXPAND_SZ) && !raw ) if ( (dwType == REG_EXPAND_SZ) && !raw )
{ {
DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue.wx_str(), NULL, 0); DWORD dwExpSize = ::ExpandEnvironmentStrings(strValue.c_str(), NULL, 0);
bool ok = dwExpSize != 0; bool ok = dwExpSize != 0;
if ( ok ) if ( ok )
{ {
wxString strExpValue; wxString strExpValue;
ok = ::ExpandEnvironmentStrings(strValue.wx_str(), ok = ::ExpandEnvironmentStrings(strValue.c_str(),
wxStringBuffer(strExpValue, dwExpSize), wxStringBuffer(strExpValue, dwExpSize),
dwExpSize dwExpSize
) != 0; ) != 0;
@@ -1408,7 +1408,7 @@ bool KeyExists(WXHKEY hRootKey, const wxString& szKey)
if ( ::RegOpenKeyEx if ( ::RegOpenKeyEx
( (
(HKEY)hRootKey, (HKEY)hRootKey,
szKey.wx_str(), szKey.c_str(),
RESERVED, RESERVED,
KEY_READ, // we might not have enough rights for rw access KEY_READ, // we might not have enough rights for rw access
&hkeyDummy &hkeyDummy
@@ -1444,7 +1444,7 @@ inline void RemoveTrailingSeparator(wxString& str)
inline const wxChar *RegValueStr(const wxString& szValue) inline const wxChar *RegValueStr(const wxString& szValue)
{ {
return szValue.empty() ? (const wxChar*)NULL : szValue.wx_str(); return szValue.empty() ? (const wxChar*)NULL : szValue.c_str();
} }
#endif // wxUSE_REGKEY #endif // wxUSE_REGKEY

View File

@@ -52,7 +52,7 @@ public:
bool Create(const wxString& name) bool Create(const wxString& name)
{ {
m_hMutex = ::CreateMutex(NULL, FALSE, name.wx_str()); m_hMutex = ::CreateMutex(NULL, FALSE, name.c_str());
if ( !m_hMutex ) if ( !m_hMutex )
{ {
wxLogLastError(_T("CreateMutex")); wxLogLastError(_T("CreateMutex"));

View File

@@ -608,7 +608,7 @@ bool wxGetEnv(const wxString& WXUNUSED_IN_WINCE(var),
return false; return false;
#else // Win32 #else // Win32
// first get the size of the buffer // first get the size of the buffer
DWORD dwRet = ::GetEnvironmentVariable(var.wx_str(), NULL, 0); DWORD dwRet = ::GetEnvironmentVariable(var.c_str(), NULL, 0);
if ( !dwRet ) if ( !dwRet )
{ {
// this means that there is no such variable // this means that there is no such variable
@@ -617,7 +617,7 @@ bool wxGetEnv(const wxString& WXUNUSED_IN_WINCE(var),
if ( value ) if ( value )
{ {
(void)::GetEnvironmentVariable(var.wx_str(), (void)::GetEnvironmentVariable(var.c_str(),
wxStringBuffer(*value, dwRet), wxStringBuffer(*value, dwRet),
dwRet); dwRet);
} }
@@ -635,7 +635,7 @@ bool wxDoSetEnv(const wxString& WXUNUSED_IN_WINCE(var),
// no environment variables under CE // no environment variables under CE
return false; return false;
#else #else
if ( !::SetEnvironmentVariable(var.wx_str(), value) ) if ( !::SetEnvironmentVariable(var.c_str(), value) )
{ {
wxLogLastError(_T("SetEnvironmentVariable")); wxLogLastError(_T("SetEnvironmentVariable"));
@@ -648,7 +648,7 @@ bool wxDoSetEnv(const wxString& WXUNUSED_IN_WINCE(var),
bool wxSetEnv(const wxString& variable, const wxString& value) bool wxSetEnv(const wxString& variable, const wxString& value)
{ {
return wxDoSetEnv(variable, value.wx_str()); return wxDoSetEnv(variable, value.c_str());
} }
bool wxUnsetEnv(const wxString& variable) bool wxUnsetEnv(const wxString& variable)