Use wxString::t_str() in calls to Windows API functions in wxMSW.

Use t_str() instead of wx_str() to make the code work correctly in UTF-8 build
in which wx_str() returns a pointer to UTF-8 buffer while we need a wchar_t
pointer for Windows.

Closes #14371.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-06-03 19:16:59 +00:00
parent f40f8e1722
commit 017dc06b50
58 changed files with 164 additions and 164 deletions

View File

@@ -323,7 +323,7 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap,
int WXUNUSED(desiredHeight))
{
// TODO: load colourmap.
bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.wx_str()));
bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.t_str()));
if ( !bitmap->IsOk() )
{
@@ -438,7 +438,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
desiredHeight == ::GetSystemMetrics(SM_CYICON) )
{
// get the specified large icon from file
if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, &hicon, NULL, 1) )
if ( !::ExtractIconEx(nameReal.t_str(), iconIndex, &hicon, NULL, 1) )
{
// it is not an error, but it might still be useful to be informed
// about it optionally
@@ -451,7 +451,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
desiredHeight == ::GetSystemMetrics(SM_CYSMICON) )
{
// get the specified small icon from file
if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, NULL, &hicon, 1) )
if ( !::ExtractIconEx(nameReal.t_str(), iconIndex, NULL, &hicon, 1) )
{
wxLogTrace(wxT("iconload"),
wxT("No small icons found in the file '%s'."),
@@ -464,7 +464,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon,
if ( !hicon )
{
// take any size icon from the file by index
hicon = ::ExtractIcon(wxGetInstance(), nameReal.wx_str(), iconIndex);
hicon = ::ExtractIcon(wxGetInstance(), nameReal.t_str(), iconIndex);
}
#endif
@@ -518,13 +518,13 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
// some icon rescaling internally which results in very ugly 16x16 icons
if ( hasSize )
{
hicon = (HICON)::LoadImage(wxGetInstance(), name.wx_str(), IMAGE_ICON,
hicon = (HICON)::LoadImage(wxGetInstance(), name.t_str(), IMAGE_ICON,
desiredWidth, desiredHeight,
LR_DEFAULTCOLOR);
}
else
{
hicon = ::LoadIcon(wxGetInstance(), name.wx_str());
hicon = ::LoadIcon(wxGetInstance(), name.t_str());
}
// next check if it's not a standard icon