Add UNICODE to Project64 project

This commit is contained in:
zilmar 2020-05-12 21:49:05 +09:30
parent 0429c207e6
commit 0462f637c4
73 changed files with 1047 additions and 1061 deletions

View File

@ -2521,15 +2521,6 @@ public:
return ::DrawText(m_hDC, lpstrText, cchText, lpRect, uFormat);
}
int DrawTextW(LPCWSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat)
{
ATLASSERT(m_hDC != NULL);
#ifndef _WIN32_WCE
ATLASSERT((uFormat & DT_MODIFYSTRING) == 0);
#endif // !_WIN32_WCE
return ::DrawTextW(m_hDC, lpstrText, cchText, lpRect, uFormat);
}
int DrawText(LPTSTR lpstrText, int cchText, LPRECT lpRect, UINT uFormat)
{
ATLASSERT(m_hDC != NULL);

View File

@ -230,7 +230,7 @@ stdstr & stdstr::FromUTF16(const wchar_t * UTF16Source, bool * bSuccess)
return *this;
}
std::wstring stdstr::ToUTF16(unsigned int CodePage, bool * bSuccess)
std::wstring stdstr::ToUTF16(unsigned int CodePage, bool * bSuccess) const
{
bool bConverted = false;
std::wstring res;

View File

@ -40,7 +40,7 @@ public:
#ifdef _WIN32
stdstr & FromUTF16(const wchar_t * UTF16Source, bool * bSuccess = NULL);
std::wstring ToUTF16(unsigned int CodePage = CODEPAGE_UTF8, bool * bSuccess = NULL);
std::wstring ToUTF16(unsigned int CodePage = CODEPAGE_UTF8, bool * bSuccess = NULL) const;
#endif
void ArgFormat(const char * strFormat, va_list & args);

View File

@ -292,7 +292,7 @@ void CRomList::FillRomList(strlist & FileList, const char * Directory)
char InternalName[22];
memcpy(InternalName, (void *)(RomData + 0x20), 20);
CN64Rom::CleanRomName(InternalName);
strcpy(RomInfo.InternalName, InternalName);
strcpy(RomInfo.InternalName, stdstr(InternalName).c_str());
}
RomInfo.RomSize = (int32_t)f->Size;

View File

@ -28,31 +28,31 @@ public:
struct ROM_INFO
{
char szFullFileName[300];
char szFullFileName[300];
FILE_FORMAT FileFormat;
char Status[60];
char FileName[200];
char InternalName[22];
char GoodName[200];
char Name[200];
char CartID[3];
char PluginNotes[250];
char CoreNotes[250];
char UserNotes[250];
char Developer[30];
char ReleaseDate[30];
char Genre[15];
int32_t Players;
uint32_t TextColor;
int32_t SelColor;
uint32_t SelTextColor;
int32_t RomSize;
uint8_t Manufacturer;
uint8_t Country;
uint32_t CRC1;
uint32_t CRC2;
CICChip CicChip;
char ForceFeedback[15];
char Status[60];
char FileName[200];
char InternalName[22];
char GoodName[200];
char Name[200];
char CartID[3];
char PluginNotes[250];
char CoreNotes[250];
char UserNotes[250];
char Developer[30];
char ReleaseDate[30];
char Genre[15];
int32_t Players;
uint32_t TextColor;
int32_t SelColor;
uint32_t SelTextColor;
int32_t RomSize;
uint8_t Manufacturer;
uint8_t Country;
uint32_t CRC1;
uint32_t CRC2;
CICChip CicChip;
char ForceFeedback[15];
};
CRomList();

View File

@ -60,7 +60,7 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc(HWND hDlg, UINT uMsg, WPARAM
BITMAP bmTL;
GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL);
hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial");
hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial");
SendDlgItemMessage(hDlg, IDC_SELECT_LANG, WM_SETFONT, (WPARAM)hTextFont, TRUE);
}
break;

View File

@ -75,7 +75,7 @@ void CPluginList::AddPluginFromDir(CPath Dir)
//UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS );
WriteTrace(TraceUserInterface, TraceDebug, "loading %s", (LPCSTR)Dir);
hLib = LoadLibrary(Dir);
hLib = LoadLibrary(stdstr((LPCSTR)Dir).ToUTF16().c_str());
//SetErrorMode(LastErrorMode);
if (hLib == NULL)

View File

@ -46,6 +46,9 @@
<Manifest Condition="'$(PlatformToolset)'!='v90'">
<EnableDPIAwareness>true</EnableDPIAwareness>
</Manifest>
<ClCompile>
<PreprocessorDefinitions>UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="UserInterface\Debugger\CPULog.cpp" />

View File

@ -43,10 +43,10 @@ void CCheatsUI::AddCodeLayers(int CheatNumber, const stdstr &CheatName, HWND hPa
TV_INSERTSTRUCT tv;
//Work out text to add
char Text[500], Item[500];
wchar_t Text[500], Item[500];
if (CheatName.length() > (sizeof(Text) - 5)) { g_Notify->BreakPoint(__FILE__, __LINE__); }
strcpy(Text, CheatName.c_str());
if (strchr(Text, '\\') > 0) { *strchr(Text, '\\') = 0; }
wcscpy(Text, CheatName.ToUTF16().c_str());
if (wcschr(Text, L'\\') > 0) { *wcschr(Text, L'\\') = 0; }
//See if text is already added
tv.item.mask = TVIF_TEXT;
@ -56,7 +56,7 @@ void CCheatsUI::AddCodeLayers(int CheatNumber, const stdstr &CheatName, HWND hPa
while (tv.item.hItem)
{
TreeView_GetItem(m_hCheatTree, &tv.item);
if (strcmp(Text, Item) == 0)
if (wcscmp(Text, Item) == 0)
{
//If already exists then just use existing one
int State = TV_GetCheckState(m_hCheatTree, (HWND)tv.item.hItem);
@ -64,7 +64,7 @@ void CCheatsUI::AddCodeLayers(int CheatNumber, const stdstr &CheatName, HWND hPa
{
TV_SetCheckState(m_hCheatTree, (HWND)tv.item.hItem, TV_STATE_INDETERMINATE);
}
size_t StartPos = strlen(Text) + 1;
size_t StartPos = wcslen(Text) + 1;
stdstr TempCheatName;
if (StartPos < CheatName.length())
{
@ -85,8 +85,8 @@ void CCheatsUI::AddCodeLayers(int CheatNumber, const stdstr &CheatName, HWND hPa
hParent = (HWND)TreeView_InsertItem(m_hCheatTree, &tv);
TV_SetCheckState(m_hCheatTree, hParent, CheatActive ? TV_STATE_CHECKED : TV_STATE_CLEAR);
if (strcmp(Text, CheatName.c_str()) == 0) { return; }
AddCodeLayers(CheatNumber, (stdstr)(CheatName.substr(strlen(Text) + 1)), hParent, CheatActive);
if (wcscmp(Text, CheatName.ToUTF16().c_str()) == 0) { return; }
AddCodeLayers(CheatNumber, (stdstr)(CheatName.substr(wcslen(Text) + 1)), hParent, CheatActive);
}
void CCheatsUI::RefreshCheatManager()
@ -114,11 +114,11 @@ stdstr CCheatsUI::GetDlgItemStr(HWND hDlg, int nIDDlgItem)
return "";
}
stdstr Result;
std::wstring Result;
Result.resize(length + 1);
GetWindowText(hDlgItem, (char *)Result.c_str(), Result.length());
return Result;
GetWindowText(hDlgItem, (wchar_t *)Result.c_str(), Result.length());
return stdstr().FromUTF16(Result.c_str());
}
void CCheatsUI::SelectCheats(HWND hParent, bool BlockExecution)
@ -186,7 +186,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
case WM_INITDIALOG:
{
CCheatsUI * _this = (CCheatsUI *)lParam;
SetProp(hDlg, "Class", _this);
SetProp(hDlg, L"Class", _this);
SetWindowTextW(GetDlgItem(hDlg, IDC_NAME), wGS(CHEAT_ADDCHEAT_NAME).c_str());
SetWindowTextW(GetDlgItem(hDlg, IDC_CODE), wGS(CHEAT_ADDCHEAT_CODE).c_str());
@ -196,7 +196,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
SetWindowTextW(GetDlgItem(hDlg, IDC_CHEATNOTES), wGS(CHEAT_ADDCHEAT_NOTES).c_str());
SetWindowTextW(GetDlgItem(hDlg, IDC_NEWCHEAT), wGS(CHEAT_ADDCHEAT_NEW).c_str());
SetWindowTextW(GetDlgItem(hDlg, IDC_ADD), wGS(CHEAT_ADDCHEAT_ADD).c_str());
SetProp(hDlg, "validcodes", false);
SetProp(hDlg, L"validcodes", false);
_this->RecordCheatValues(hDlg);
}
break;
@ -279,7 +279,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
break;
case IDC_ADD:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
stdstr NewCheatName = GetDlgItemStr(hDlg, IDC_CODE_NAME);
int i = 0;
@ -327,17 +327,17 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
break;
case IDC_NEWCHEAT:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
if (_this->CheatChanged(hDlg))
{
break;
}
_this->m_EditCheat = -1;
SetDlgItemText(hDlg, IDC_CODE_NAME, "");
SetDlgItemText(hDlg, IDC_CHEAT_CODES, "");
SetDlgItemText(hDlg, IDC_CHEAT_OPTIONS, "");
SetDlgItemText(hDlg, IDC_NOTES, "");
SetDlgItemText(hDlg, IDC_CODE_NAME, L"");
SetDlgItemText(hDlg, IDC_CHEAT_CODES, L"");
SetDlgItemText(hDlg, IDC_CHEAT_OPTIONS, L"");
SetDlgItemText(hDlg, IDC_NOTES, L"");
EnableWindow(GetDlgItem(hDlg, IDC_ADD), false);
EnableWindow(GetDlgItem(hDlg, IDC_CHEAT_OPTIONS), false);
SetDlgItemTextW(hDlg, IDC_ADD, wGS(CHEAT_ADDNEW).c_str());
@ -349,7 +349,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
break;
case WM_EDITCHEAT:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
_this->m_EditCheat = wParam;
if (_this->m_EditCheat < 0)
{
@ -368,7 +368,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
int len = strrchr(String, '"') - strchr(String, '"') - 1;
stdstr CheatName(strchr(String, '"') + 1);
CheatName.resize(len);
SetDlgItemText(hDlg, IDC_CODE_NAME, CheatName.c_str());
SetDlgItemText(hDlg, IDC_CODE_NAME, CheatName.ToUTF16().c_str());
//Add Gameshark codes to screen
const char * ReadPos = strrchr(String, '"') + 2;
@ -392,7 +392,7 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
ReadPos += 1;
}
} while (ReadPos);
SetDlgItemText(hDlg, IDC_CHEAT_CODES, Buffer.c_str());
SetDlgItemText(hDlg, IDC_CHEAT_CODES, Buffer.ToUTF16().c_str());
//Add option values to screen
stdstr CheatOptionStr = g_Settings->LoadStringIndex(Cheat_Options, _this->m_EditCheat);
@ -420,11 +420,11 @@ int CALLBACK CCheatsUI::CheatAddProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
}
} while (ReadPos);
}
SetDlgItemText(hDlg, IDC_CHEAT_OPTIONS, Buffer.c_str());
SetDlgItemText(hDlg, IDC_CHEAT_OPTIONS, Buffer.ToUTF16().c_str());
//Add cheat Notes
stdstr CheatNotesStr = g_Settings->LoadStringIndex(Cheat_Notes, _this->m_EditCheat);
SetDlgItemText(hDlg, IDC_NOTES, CheatNotesStr.c_str());
SetDlgItemText(hDlg, IDC_NOTES, CheatNotesStr.ToUTF16().c_str());
SendMessage(hDlg, WM_COMMAND, MAKELPARAM(IDC_CHEAT_CODES, EN_CHANGE), (LPARAM)GetDlgItem(hDlg, IDC_CHEAT_CODES));
SetDlgItemTextW(hDlg, IDC_ADD, wGS(CHEAT_EDITCHEAT_UPDATE).c_str());
@ -445,7 +445,7 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
case WM_INITDIALOG:
{
CCheatsUI * _this = (CCheatsUI *)lParam;
SetProp(hDlg, "Class", _this);
SetProp(hDlg, L"Class", _this);
uint32_t Style;
RECT rcList;
@ -457,7 +457,7 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
GetWindowRect(hDlg, &rcList);
GetWindowRect(GetDlgItem(hDlg, IDC_UNMARK), &rcButton);
_this->m_hCheatTree = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, "",
_this->m_hCheatTree = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, L"",
WS_CHILD | WS_VISIBLE | WS_VSCROLL | TVS_HASLINES |
TVS_HASBUTTONS | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_TABSTOP |
TVS_FULLROWSELECT, 6, 4, rcList.right - rcList.left - 13,
@ -481,7 +481,7 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
break;
case WM_COMMAND:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
switch (LOWORD(wParam))
{
@ -514,7 +514,7 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
break;
case WM_NOTIFY:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
if (_this->m_DeleteingEntries)
{
@ -646,7 +646,7 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
TreeView_GetItem(_this->m_hCheatTree, &item);
stdstr Notes(g_Settings->LoadStringIndex(Cheat_Notes, item.lParam));
SetDlgItemText(hDlg, IDC_NOTES, Notes.c_str());
SetDlgItemText(hDlg, IDC_NOTES, Notes.ToUTF16().c_str());
if (_this->m_AddCheat)
{
SendMessage(_this->m_AddCheat, WM_EDITCHEAT, item.lParam, 0); //edit cheat
@ -654,15 +654,15 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
}
else
{
SetDlgItemText(hDlg, IDC_NOTES, "");
SetDlgItemText(hDlg, IDC_NOTES, L"");
}
}
}
break;
case UM_CHANGECODEEXTENSION:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
;
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
//Get the selected item
_this->m_hSelectedItem = (HWND)lParam;
TVITEM item;
@ -702,8 +702,9 @@ int CALLBACK CCheatsUI::CheatListProc(HWND hDlg, uint32_t uMsg, uint32_t wParam,
{
Cheat += 1;
}
std::wstring wcCheat = stdstr(Cheat).ToUTF16();
item.mask = TVIF_TEXT;
item.pszText = Cheat;
item.pszText = (LPWSTR)wcCheat.c_str();
item.cchTextMax = CheatName.length();
TreeView_SetItem(_this->m_hCheatTree, &item);
}
@ -721,7 +722,7 @@ int CALLBACK CCheatsUI::CheatsCodeExProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
case WM_INITDIALOG:
{
CCheatsUI * _this = (CCheatsUI *)lParam;
SetProp(hDlg, "Class", _this);
SetProp(hDlg, L"Class", _this);
//Find the cheat Number of the option being selected
TVITEM item;
@ -735,7 +736,7 @@ int CALLBACK CCheatsUI::CheatsCodeExProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
SetDlgItemTextW(hDlg, IDC_NOTE, wGS(CHEAT_CODE_EXT_TXT).c_str());
SetDlgItemTextW(hDlg, IDOK, wGS(CHEAT_OK).c_str());
SetDlgItemTextW(hDlg, IDCANCEL, wGS(CHEAT_CANCEL).c_str());
SetDlgItemText(hDlg, IDC_CHEAT_NAME, CheatName.c_str());
SetDlgItemText(hDlg, IDC_CHEAT_NAME, CheatName.ToUTF16().c_str());
//Read through and add all options to the list box
stdstr Options(g_Settings->LoadStringIndex(Cheat_Options, item.lParam));
@ -765,7 +766,7 @@ int CALLBACK CCheatsUI::CheatsCodeExProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
break;
case IDOK:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
//Find the cheat Number of the option being selected
TVITEM item;
@ -785,11 +786,11 @@ int CALLBACK CCheatsUI::CheatsCodeExProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
g_BaseSystem->SetCheatsSlectionChanged(true);
}
}
RemoveProp(hDlg, "Class");
RemoveProp(hDlg, L"Class");
EndDialog(hDlg, 0);
break;
case IDCANCEL:
RemoveProp(hDlg, "Class");
RemoveProp(hDlg, L"Class");
EndDialog(hDlg, 0);
break;
}
@ -807,8 +808,8 @@ int CALLBACK CCheatsUI::CheatsCodeQuantProc(HWND hDlg, uint32_t uMsg, uint32_t w
{
case WM_INITDIALOG:
{
CCheatsUI * _this = (CCheatsUI *)lParam;
SetProp(hDlg, "Class", _this);
CCheatsUI * _this = (CCheatsUI *)lParam;
SetProp(hDlg, L"Class", _this);
//Find the cheat Number of the option being selected
TVITEM item;
@ -825,9 +826,9 @@ int CALLBACK CCheatsUI::CheatsCodeQuantProc(HWND hDlg, uint32_t uMsg, uint32_t w
SetDlgItemTextW(hDlg, IDC_DIGITAL_TEXT, wGS(CHEAT_CHOOSE_VALUE).c_str());
SetDlgItemTextW(hDlg, IDC_VALUE_TEXT, wGS(CHEAT_VALUE).c_str());
SetDlgItemTextW(hDlg, IDC_NOTES_TEXT, wGS(CHEAT_NOTES).c_str());
SetDlgItemText(hDlg, IDC_NOTES, RangeNote.c_str());
SetDlgItemText(hDlg, IDC_CHEAT_NAME, CheatName.c_str());
SetDlgItemText(hDlg, IDC_VALUE, Value.c_str());
SetDlgItemText(hDlg, IDC_NOTES, RangeNote.ToUTF16().c_str());
SetDlgItemText(hDlg, IDC_CHEAT_NAME, CheatName.ToUTF16().c_str());
SetDlgItemText(hDlg, IDC_VALUE, Value.ToUTF16().c_str());
Start = (uint16_t)(Range.c_str()[0] == '$' ? strtoul(&Range.c_str()[1], 0, 16) : atol(Range.c_str()));
const char * ReadPos = strrchr(Range.c_str(), '-');
@ -842,7 +843,7 @@ int CALLBACK CCheatsUI::CheatsCodeQuantProc(HWND hDlg, uint32_t uMsg, uint32_t w
char Text[500];
sprintf(Text, "%s $%X %s $%X", GS(CHEAT_FROM), Start, GS(CHEAT_TO), Stop);
SetDlgItemText(hDlg, IDC_RANGE, Text);
SetDlgItemText(hDlg, IDC_RANGE, stdstr(Text).ToUTF16().c_str());
}
break;
case WM_COMMAND:
@ -854,14 +855,14 @@ int CALLBACK CCheatsUI::CheatsCodeQuantProc(HWND hDlg, uint32_t uMsg, uint32_t w
TCHAR szTmp[10], szTmp2[10];
uint32_t Value;
GetDlgItemText(hDlg, IDC_VALUE, szTmp, sizeof(szTmp));
Value = szTmp[0] == '$' ? strtoul(&szTmp[1], 0, 16) : strtoul(&szTmp[0], 0, 16);
Value = szTmp[0] == '$' ? wcstoul(&szTmp[1], 0, 16) : wcstoul(&szTmp[0], 0, 16);
if (Value > Stop) { Value = Stop; }
if (Value < Start) { Value = Start; }
sprintf(szTmp2, "$%X", Value);
if (strcmp(szTmp, szTmp2) != 0)
wsprintf(szTmp2, L"$%X", Value);
if (wcscmp(szTmp, szTmp2) != 0)
{
SetDlgItemText(hDlg, IDC_VALUE, szTmp2);
if (SelStop == 0) { SelStop = (uint16_t)strlen(szTmp2); SelStart = SelStop; }
if (SelStop == 0) { SelStop = (uint16_t)wcslen(szTmp2); SelStart = SelStop; }
SendDlgItemMessage(hDlg, IDC_VALUE, EM_SETSEL, (WPARAM)SelStart, (LPARAM)SelStop);
}
else
@ -874,7 +875,7 @@ int CALLBACK CCheatsUI::CheatsCodeQuantProc(HWND hDlg, uint32_t uMsg, uint32_t w
break;
case IDOK:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
//Find the cheat Number of the option being selected
TVITEM item;
@ -887,22 +888,22 @@ int CALLBACK CCheatsUI::CheatsCodeQuantProc(HWND hDlg, uint32_t uMsg, uint32_t w
uint32_t Value;
GetDlgItemText(hDlg, IDC_VALUE, szTmp, sizeof(szTmp));
Value = szTmp[0] == '$' ? strtol(&szTmp[1], 0, 16) : strtol(&szTmp[0], 0, 16);
Value = szTmp[0] == L'$' ? wcstol(&szTmp[1], 0, 16) : wcstol(&szTmp[0], 0, 16);
if (Value > Stop) { Value = Stop; }
if (Value < Start) { Value = Start; }
sprintf(CheatExten, "$%X", Value);
wsprintf(CheatExten, L"$%X", Value);
g_Settings->SaveStringIndex(Cheat_Extension, item.lParam, CheatExten);
g_Settings->SaveStringIndex(Cheat_Extension, item.lParam, stdstr().FromUTF16(CheatExten).c_str());
if (g_BaseSystem)
{
g_BaseSystem->SetCheatsSlectionChanged(true);
}
}
RemoveProp(hDlg, "Class");
RemoveProp(hDlg, L"Class");
EndDialog(hDlg, 0);
break;
case IDCANCEL:
RemoveProp(hDlg, "Class");
RemoveProp(hDlg, L"Class");
EndDialog(hDlg, 0);
break;
}
@ -928,7 +929,7 @@ int CALLBACK CCheatsUI::ManageCheatsProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
case WM_INITDIALOG:
{
CCheatsUI * _this = (CCheatsUI *)lParam;
SetProp(hDlg, "Class", _this);
SetProp(hDlg, L"Class", _this);
_this->m_Window = hDlg;
WINDOWPLACEMENT WndPlac;
@ -998,14 +999,14 @@ int CALLBACK CCheatsUI::ManageCheatsProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
{
case IDCANCEL:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
if (_this->m_AddCheat)
{
DestroyWindow(_this->m_AddCheat);
_this->m_AddCheat = NULL;
}
_this->m_Window = NULL;
RemoveProp(hDlg, "Class");
RemoveProp(hDlg, L"Class");
EndDialog(hDlg, 0);
if (g_BaseSystem)
{
@ -1020,7 +1021,7 @@ int CALLBACK CCheatsUI::ManageCheatsProc(HWND hDlg, uint32_t uMsg, uint32_t wPar
break;
case IDC_STATE:
{
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, "Class");
CCheatsUI * _this = (CCheatsUI *)GetProp(hDlg, L"Class");
WINDOWPLACEMENT WndPlac;
WndPlac.length = sizeof(WndPlac);
GetWindowPlacement(hDlg, &WndPlac);

View File

@ -23,7 +23,7 @@ uint32_t CAssembler::m_Address = 0;
char* CAssembler::m_TokContext = NULL;
bool CAssembler::AssembleLine(char* line, uint32_t* opcode, uint32_t address)
bool CAssembler::AssembleLine(const char* line, uint32_t* opcode, uint32_t address)
{
m_ParseError = ERR_NONE;
m_Address = address;

View File

@ -42,7 +42,7 @@ private:
static ASM_PARSE_ERROR m_ParseError;
public:
static bool AssembleLine(char* line, uint32_t* opcode, uint32_t address = 0x00000000);
static bool AssembleLine(const char* line, uint32_t* opcode, uint32_t address = 0x00000000);
private:

View File

@ -29,9 +29,9 @@ LRESULT CAddBreakpointDlg::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND, BOOL&
{
case IDOK:
{
char addrStr[9];
m_AddressEdit.GetWindowTextA(addrStr, 9);
uint32_t address = strtoul(addrStr, NULL, 16);
wchar_t addrStr[9];
m_AddressEdit.GetWindowText(addrStr, 9);
uint32_t address = wcstoul(addrStr, NULL, 16);
CBreakpoints* breakpoints = m_Debugger->Breakpoints();

View File

@ -31,10 +31,10 @@ LRESULT CAddSymbolDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
{
break;
}
m_TypeComboBox.AddString(typeName);
m_TypeComboBox.AddString(stdstr(typeName).ToUTF16().c_str());
}
m_AddressEdit.SetWindowTextA("");
m_AddressEdit.SetWindowText(L"");
m_AddressEdit.SetFocus();
if (m_bHaveAddress)
@ -64,33 +64,33 @@ LRESULT CAddSymbolDlg::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*
EndDialog(0);
break;
case IDOK:
int addrLen = m_AddressEdit.GetWindowTextLengthA();
int addrLen = m_AddressEdit.GetWindowTextLength();
if (!addrLen)
{
MessageBox("Address required", "Error", MB_OK);
MessageBox(L"Address required", L"Error", MB_OK);
return 0;
}
uint32_t address = m_AddressEdit.GetValue();
int type = m_TypeComboBox.GetCurSel();
int nameLen = m_NameEdit.GetWindowTextLengthA();
int descLen = m_DescriptionEdit.GetWindowTextLengthA();
int nameLen = m_NameEdit.GetWindowTextLength();
int descLen = m_DescriptionEdit.GetWindowTextLength();
if (!nameLen && !descLen)
{
MessageBox("Name and/or description required", "Error", MB_OK);
MessageBox(L"Name and/or description required", L"Error", MB_OK);
return 0;
}
char name[128];
char description[256];
wchar_t name[128];
wchar_t description[256];
m_NameEdit.GetWindowTextA(name, nameLen + 1);
m_DescriptionEdit.GetWindowTextA(description, descLen + 1);
m_NameEdit.GetWindowText(name, nameLen + 1);
m_DescriptionEdit.GetWindowText(description, descLen + 1);
m_Debugger->SymbolTable()->AddSymbol(type, address, name, description);
m_Debugger->SymbolTable()->AddSymbol(type, address, stdstr().FromUTF16(name).c_str(), stdstr().FromUTF16(description).c_str());
m_Debugger->SymbolTable()->Save();
m_Debugger->Debug_RefreshSymbolsWindow();

View File

@ -50,9 +50,9 @@ LRESULT CDebugCPULogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
m_CPUListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_CPUListView.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
m_CPUListView.AddColumn("PC", 0);
m_CPUListView.AddColumn("Command", 1);
m_CPUListView.AddColumn("Parameters", 2);
m_CPUListView.AddColumn(L"PC", 0);
m_CPUListView.AddColumn(L"Command", 1);
m_CPUListView.AddColumn(L"Parameters", 2);
m_CPUListView.SetColumnWidth(0, 65);
m_CPUListView.SetColumnWidth(1, 60);
m_CPUListView.SetColumnWidth(2, 120);
@ -345,9 +345,9 @@ void CDebugCPULogView::RefreshList(bool bUpdateBuffer)
char* szCmdName = strtok_s((char*)szCommand, "\t", &tokctx);
char* szCmdArgs = strtok_s(NULL, "\t", &tokctx);
m_CPUListView.AddItem(nItem, 0, szPC);
m_CPUListView.AddItem(nItem, 1, szCmdName);
m_CPUListView.AddItem(nItem, 2, szCmdArgs);
m_CPUListView.AddItem(nItem, 0, stdstr(szPC).ToUTF16().c_str());
m_CPUListView.AddItem(nItem, 1, stdstr(szCmdName).ToUTF16().c_str());
m_CPUListView.AddItem(nItem, 2, stdstr(szCmdArgs).ToUTF16().c_str());
nItem++;
}
@ -391,7 +391,7 @@ void CDebugCPULogView::ShowRegStates(size_t stateIndex)
out += sprintf(out, "FPCR: %08X\r\n", state->fpcr);
m_StateInfoEdit.SetWindowTextA(szRegStates);
m_StateInfoEdit.SetWindowText(stdstr(szRegStates).ToUTF16().c_str());
}
void CDebugCPULogView::Export(void)
@ -401,7 +401,7 @@ void CDebugCPULogView::Export(void)
return;
}
OPENFILENAME openfilename;
OPENFILENAMEA openfilename;
char filePath[255];
memset(&filePath, 0, sizeof(filePath));
@ -417,7 +417,7 @@ void CDebugCPULogView::Export(void)
openfilename.nMaxFile = MAX_PATH;
openfilename.Flags = OFN_HIDEREADONLY;
if (GetSaveFileName(&openfilename))
if (GetSaveFileNameA(&openfilename))
{
m_CPULogCopy->DumpToFile(filePath);
}

View File

@ -26,19 +26,19 @@ void CCommandList::Attach(HWND hWndNew)
ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP);
AddColumn("", COL_ARROWS);
AddColumn(L"", COL_ARROWS);
SetColumnWidth(COL_ARROWS, 30);
AddColumn("Address", COL_ADDRESS);
AddColumn(L"Address", COL_ADDRESS);
SetColumnWidth(COL_ADDRESS, 70);
AddColumn("Command", COL_COMMAND);
AddColumn(L"Command", COL_COMMAND);
SetColumnWidth(COL_COMMAND, 65);
AddColumn("Parameters", COL_PARAMETERS);
AddColumn(L"Parameters", COL_PARAMETERS);
SetColumnWidth(COL_PARAMETERS, 130);
AddColumn("Symbol", COL_SYMBOL);
AddColumn(L"Symbol", COL_SYMBOL);
SetColumnWidth(COL_SYMBOL, 180);
}
@ -173,10 +173,10 @@ void CDebugCommandsView::RecompilerCheck(void)
!g_Settings->LoadBool(Setting_ForceInterpreterCPU) &&
(CPU_TYPE)g_Settings->LoadDword(Game_CpuType) != CPU_Interpreter)
{
MessageBox("Debugger support for the recompiler core is experimental.\n\n"
"For optimal experience, enable \"Always use interpreter core\" "
"in advanced settings and restart the emulator.",
"Warning", MB_ICONWARNING | MB_OK);
MessageBox(L"Debugger support for the recompiler core is experimental.\n\n"
L"For optimal experience, enable \"Always use interpreter core\" "
L"in advanced settings and restart the emulator.",
L"Warning", MB_ICONWARNING | MB_OK);
}
}
@ -271,13 +271,13 @@ LRESULT CDebugCommandsView::OnOpKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*l
}
else if (wParam == VK_RETURN)
{
char text[256] = { 0 };
m_OpEdit.GetWindowTextA(text, sizeof(text) - 1);
wchar_t text[256] = { 0 };
m_OpEdit.GetWindowText(text, (sizeof(text) / sizeof(text[0])) - 1);
uint32_t op;
bool bValid = CAssembler::AssembleLine(text, &op, m_SelectedAddress);
bool bValid = CAssembler::AssembleLine(stdstr().FromUTF16(text).c_str(), &op, m_SelectedAddress);
if (bValid)
{
m_OpEdit.SetWindowTextA("");
m_OpEdit.SetWindowText(L"");
EditOp(m_SelectedAddress, op);
m_SelectedAddress += 4;
BeginOpEdit(m_SelectedAddress);
@ -568,19 +568,19 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
{
uint32_t opAddr = m_StartAddress + i * 4;
m_CommandList.AddItem(i, CCommandList::COL_ARROWS, " ");
m_CommandList.AddItem(i, CCommandList::COL_ARROWS, L" ");
char addrStr[9];
sprintf(addrStr, "%08X", opAddr);
m_CommandList.AddItem(i, CCommandList::COL_ADDRESS, addrStr);
m_CommandList.AddItem(i, CCommandList::COL_ADDRESS, stdstr(addrStr).ToUTF16().c_str());
COpInfo OpInfo;
OPCODE& OpCode = OpInfo.m_OpCode;
if (!m_Debugger->DebugLoad_VAddr(opAddr, OpCode.Hex))
{
m_CommandList.AddItem(i, CCommandList::COL_COMMAND, "***");
m_CommandList.AddItem(i, CCommandList::COL_COMMAND, L"***");
m_bvAnnotatedLines.push_back(false);
continue;
}
@ -652,20 +652,20 @@ void CDebugCommandsView::ShowAddress(uint32_t address, bool top, bool bUserInput
bLoadStoreAnnotation = true;
}
m_CommandList.AddItem(i, CCommandList::COL_COMMAND, cmdName);
m_CommandList.AddItem(i, CCommandList::COL_PARAMETERS, cmdArgs);
m_CommandList.AddItem(i, CCommandList::COL_COMMAND, stdstr(cmdName).ToUTF16().c_str());
m_CommandList.AddItem(i, CCommandList::COL_PARAMETERS, stdstr(cmdArgs).ToUTF16().c_str());
// Show routine symbol name for this address
CSymbol pcSymbol;
if (m_Debugger->SymbolTable()->GetSymbolByAddress(opAddr, &pcSymbol))
{
m_CommandList.AddItem(i, CCommandList::COL_SYMBOL, pcSymbol.m_Name);
m_CommandList.AddItem(i, CCommandList::COL_SYMBOL, stdstr(pcSymbol.m_Name).ToUTF16().c_str());
m_bvAnnotatedLines.push_back(false);
}
else if (annotation != NULL)
{
const char* annotationFormat = bLoadStoreAnnotation ? "// (%s)" : "// %s";
m_CommandList.AddItem(i, CCommandList::COL_SYMBOL, stdstr_f(annotationFormat, annotation).c_str());
m_CommandList.AddItem(i, CCommandList::COL_SYMBOL, stdstr_f(annotationFormat, annotation).ToUTF16().c_str());
m_bvAnnotatedLines.push_back(true);
}
else
@ -1030,7 +1030,7 @@ void CDebugCommandsView::RefreshBreakpointList()
for (CBreakpoints::breakpoints_t::iterator itr = ReadBreakPoints.begin(); itr != ReadBreakPoints.end(); itr++)
{
sprintf(rowStr, "R %s%08X", itr->second ? "T " : "", itr->first);
int index = m_BreakpointList.AddString(rowStr);
int index = m_BreakpointList.AddString(stdstr(rowStr).ToUTF16().c_str());
m_BreakpointList.SetItemData(index, itr->first);
}
@ -1038,7 +1038,7 @@ void CDebugCommandsView::RefreshBreakpointList()
for (CBreakpoints::breakpoints_t::iterator itr = WriteBreakPoints.begin(); itr != WriteBreakPoints.end(); itr++)
{
sprintf(rowStr, "W %s%08X", itr->second ? "T " : "", itr->first);
int index = m_BreakpointList.AddString(rowStr);
int index = m_BreakpointList.AddString(stdstr(rowStr).ToUTF16().c_str());
m_BreakpointList.SetItemData(index, itr->first);
}
@ -1046,7 +1046,7 @@ void CDebugCommandsView::RefreshBreakpointList()
for (CBreakpoints::breakpoints_t::iterator itr = ExecutionBreakPoints.begin(); itr != ExecutionBreakPoints.end(); itr++)
{
sprintf(rowStr, "E %s%08X", itr->second ? "T " : "", itr->first);
int index = m_BreakpointList.AddString(rowStr);
int index = m_BreakpointList.AddString(stdstr(rowStr).ToUTF16().c_str());
m_BreakpointList.SetItemData(index, itr->first);
}
}
@ -1060,20 +1060,20 @@ void CDebugCommandsView::RemoveSelectedBreakpoints()
return;
}
char itemText[32];
wchar_t itemText[32];
m_BreakpointList.GetText(nItem, itemText);
uint32_t address = m_BreakpointList.GetItemData(nItem);
switch (itemText[0])
{
case 'E':
case L'E':
m_Breakpoints->RemoveExecution(address);
break;
case 'W':
case L'W':
m_Breakpoints->WBPRemove(address);
break;
case 'R':
case L'R':
m_Breakpoints->RBPRemove(address);
break;
}
@ -1325,7 +1325,7 @@ void CDebugCommandsView::BeginOpEdit(uint32_t address)
m_OpEdit.ShowWindow(SW_SHOW);
m_OpEdit.MoveWindow(&itemRect);
m_OpEdit.BringWindowToTop();
m_OpEdit.SetWindowTextA(command);
m_OpEdit.SetWindowText(stdstr(command).ToUTF16().c_str());
m_OpEdit.SetFocus();
m_OpEdit.SetSelAll();
@ -1336,7 +1336,7 @@ void CDebugCommandsView::BeginOpEdit(uint32_t address)
void CDebugCommandsView::EndOpEdit()
{
m_bEditing = false;
m_OpEdit.SetWindowTextA("");
m_OpEdit.SetWindowText(L"");
m_OpEdit.ShowWindow(SW_HIDE);
}
@ -1481,10 +1481,10 @@ LRESULT CDebugCommandsView::OnListBoxClicked(WORD /*wNotifyCode*/, WORD wID, HWN
int index = m_BreakpointList.GetCaretIndex();
uint32_t address = m_BreakpointList.GetItemData(index);
int len = m_BreakpointList.GetTextLen(index);
char* rowText = (char*)malloc(len + 1);
wchar_t* rowText = (wchar_t*)malloc((len + 1) * sizeof(wchar_t));
rowText[len] = '\0';
m_BreakpointList.GetText(index, rowText);
if (*rowText == 'E')
if (*rowText == L'E')
{
ShowAddress(address, true);
}

View File

@ -96,9 +96,9 @@ void CDebugDMALogView::RefreshList()
// continue;
//}
m_DMAList.AddItem(itemIndex, 0, stdstr_f("%08X", lpEntry->romAddr).c_str());
m_DMAList.AddItem(itemIndex, 1, stdstr_f("%08X", lpEntry->ramAddr).c_str());
m_DMAList.AddItem(itemIndex, 2, stdstr_f("%08X (%d)", lpEntry->length, lpEntry->length).c_str());
m_DMAList.AddItem(itemIndex, 0, stdstr_f("%08X", lpEntry->romAddr).ToUTF16().c_str());
m_DMAList.AddItem(itemIndex, 1, stdstr_f("%08X", lpEntry->ramAddr).ToUTF16().c_str());
m_DMAList.AddItem(itemIndex, 2, stdstr_f("%08X (%d)", lpEntry->length, lpEntry->length).ToUTF16().c_str());
union
{
@ -114,7 +114,7 @@ void CDebugDMALogView::RefreshList()
// Todo checkbox to display all in hex
if (isalnum(sig.sz[0]) && isalnum(sig.sz[1]) && isalnum(sig.sz[2]) && isalnum(sig.sz[3]))
{
m_DMAList.AddItem(itemIndex, 4, (char*)sig.sz);
m_DMAList.AddItem(itemIndex, 4, stdstr((char*)sig.sz).ToUTF16().c_str());
}
itemIndex++;
@ -151,11 +151,11 @@ LRESULT CDebugDMALogView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
m_DMAList.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
m_DMAList.AddColumn("ROM", 0);
m_DMAList.AddColumn("RAM", 1);
m_DMAList.AddColumn("Length", 2);
m_DMAList.AddColumn("Symbol (RAM)", 3);
m_DMAList.AddColumn("Signature", 4);
m_DMAList.AddColumn(L"ROM", 0);
m_DMAList.AddColumn(L"RAM", 1);
m_DMAList.AddColumn(L"Length", 2);
m_DMAList.AddColumn(L"Symbol (RAM)", 3);
m_DMAList.AddColumn(L"Signature", 4);
m_DMAList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
@ -244,11 +244,11 @@ LRESULT CDebugDMALogView::OnRamAddrChanged(WORD /*wNotifyCode*/, WORD /*wID*/, H
return FALSE;
}
char szRamAddr[9];
wchar_t szRamAddr[9];
char szRomAddr[9];
m_DMARamEdit.GetWindowTextA(szRamAddr, 9);
uint32_t ramAddr = strtoul(szRamAddr, NULL, 16);
m_DMARamEdit.GetWindowText(szRamAddr, 9);
uint32_t ramAddr = wcstoul(szRamAddr, NULL, 16);
uint32_t romAddr, offset;
DMALOGENTRY* lpEntry = m_DMALog->GetEntryByRamAddress(ramAddr, &romAddr, &offset);
@ -256,17 +256,17 @@ LRESULT CDebugDMALogView::OnRamAddrChanged(WORD /*wNotifyCode*/, WORD /*wID*/, H
if (lpEntry != NULL)
{
sprintf(szRomAddr, "%08X", romAddr);
stdstr blockInfo = stdstr_f("Block: %08X -> %08X [%X] +%X", romAddr, ramAddr, lpEntry->length, offset);
m_BlockInfo.SetWindowTextA(blockInfo.c_str());
stdstr_f blockInfo("Block: %08X -> %08X [%X] +%X", romAddr, ramAddr, lpEntry->length, offset);
m_BlockInfo.SetWindowText(blockInfo.ToUTF16().c_str());
}
else
{
sprintf(szRomAddr, "????????");
m_BlockInfo.SetWindowTextA("Block: ?");
m_BlockInfo.SetWindowText(L"Block: ?");
}
m_bConvertingAddress = true;
m_DMARomEdit.SetWindowTextA(szRomAddr);
m_DMARomEdit.SetWindowText(stdstr(szRomAddr).ToUTF16().c_str());
m_bConvertingAddress = false;
return FALSE;
}
@ -278,29 +278,29 @@ LRESULT CDebugDMALogView::OnRomAddrChanged(WORD /*wNotifyCode*/, WORD /*wID*/, H
return FALSE;
}
char szRamAddr[9];
char szRomAddr[9];
wchar_t szRamAddr[9];
wchar_t szRomAddr[9];
m_DMARomEdit.GetWindowTextA(szRomAddr, 9);
uint32_t romAddr = strtoul(szRomAddr, NULL, 16);
m_DMARomEdit.GetWindowText(szRomAddr, 9);
uint32_t romAddr = wcstoul(szRomAddr, NULL, 16);
uint32_t ramAddr, offset;
DMALOGENTRY* lpEntry = m_DMALog->GetEntryByRomAddress(romAddr, &ramAddr, &offset);
if (lpEntry != NULL)
{
sprintf(szRamAddr, "%08X", ramAddr);
wsprintf(szRamAddr, L"%08X", ramAddr);
stdstr blockInfo = stdstr_f("Block: %08X -> %08X [%X] +%X", romAddr, ramAddr, lpEntry->length, offset);
m_BlockInfo.SetWindowTextA(blockInfo.c_str());
m_BlockInfo.SetWindowText(blockInfo.ToUTF16().c_str());
}
else
{
sprintf(szRamAddr, "????????");
m_BlockInfo.SetWindowTextA("Block: ?");
wsprintf(szRamAddr, L"????????");
m_BlockInfo.SetWindowText(L"Block: ?");
}
m_bConvertingAddress = true;
m_DMARamEdit.SetWindowTextA(szRamAddr);
m_DMARamEdit.SetWindowText(szRamAddr);
m_bConvertingAddress = false;
return FALSE;
}

View File

@ -44,10 +44,10 @@ LRESULT CDumpMemory::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPa
m_EndAddress.SetValue(endAddress, DisplayMode::AllHex);
m_PC.SetValue(startAddress);
int nIndex = m_FormatList.AddString("TEXT - Disassembly + PC");
int nIndex = m_FormatList.AddString(L"TEXT - Disassembly + PC");
m_FormatList.SetItemData(nIndex, (DWORD_PTR)DisassemblyWithPC);
nIndex = m_FormatList.AddString("RAW - Big Endian (N64)");
nIndex = m_FormatList.AddString(L"RAW - Big Endian (N64)");
m_FormatList.SetItemData(nIndex, (LPARAM)RawBigEndian);
m_FormatList.SetCurSel(0);
@ -94,7 +94,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl
if (FileName.GetExtension().length() == 0)
{
FileName.SetExtension(Format == RawBigEndian ? "bin" : "txt");
m_FileName.SetWindowTextA(FileName);
m_FileName.SetWindowText(stdstr((const char *)FileName).ToUTF16().c_str());
}
}
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_DumpMemory);
@ -110,7 +110,7 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl
DWORD EndPC = m_EndAddress.GetValue();
DWORD DumpPC = m_PC.GetValue();
GetDlgItemText(IDC_FILENAME, FileName, sizeof(FileName));
if (strlen(FileName) == 0)
if (wcslen(FileName) == 0)
{
g_Notify->DisplayWarning("Please Choose target file");
::SetFocus(GetDlgItem(IDC_FILENAME));
@ -145,14 +145,16 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl
return FALSE;
}
bool CDumpMemory::DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC)
bool CDumpMemory::DumpMemory(LPCTSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC)
{
stdstr strFile = stdstr().FromUTF16(FileName);
if (Format == DisassemblyWithPC)
{
CLog LogFile;
if (!LogFile.Open(FileName))
if (!LogFile.Open(strFile.c_str()))
{
g_Notify->DisplayError(stdstr_f("Failed to open\n%s", FileName).c_str());
g_Notify->DisplayError(stdstr_f("Failed to open\n%s", strFile.c_str()).c_str());
return false;
}
LogFile.SetFlush(false);
@ -181,9 +183,9 @@ bool CDumpMemory::DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC,
{
CFile dumpFile;
if (!dumpFile.Open(FileName, CFile::modeCreate | CFile::modeWrite))
if (!dumpFile.Open(strFile.c_str(), CFile::modeCreate | CFile::modeWrite))
{
g_Notify->DisplayError(stdstr_f("Failed to open\n%s", FileName).c_str());
g_Notify->DisplayError(stdstr_f("Failed to open\n%s", strFile.c_str()).c_str());
return false;
}
@ -197,7 +199,7 @@ bool CDumpMemory::DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC,
if (!bReadable)
{
g_Notify->DisplayError(stdstr_f("Address error\n%s", FileName).c_str());
g_Notify->DisplayError(stdstr_f("Address error\n%s", strFile.c_str()).c_str());
dumpFile.Close();
free(dumpBuf);
return false;

View File

@ -40,7 +40,7 @@ private:
LRESULT OnClicked(WORD wNotifyCode, WORD wID, HWND /*hWndCtl*/, BOOL& bHandled);
void OnExitSizeMove(void);
bool DumpMemory(LPCSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC);
bool DumpMemory(LPCTSTR FileName, DumpFormat Format, DWORD StartPC, DWORD EndPC, DWORD DumpPC);
CComboBox m_FormatList;
CEdit m_FileName;

View File

@ -66,32 +66,32 @@ LRESULT CDebugMemorySearch::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARA
UpdateOptions(); // setup search type combobox
CComboBox & vtcb = m_ValueTypeOptions;
vtcb.SetItemData(vtcb.AddString("int8"), ValueType_int8);
vtcb.SetItemData(vtcb.AddString("int16"), ValueType_int16);
vtcb.SetItemData(vtcb.AddString("int32"), ValueType_int32);
vtcb.SetItemData(vtcb.AddString("int64"), ValueType_int64);
vtcb.SetItemData(vtcb.AddString("float"), ValueType_float);
vtcb.SetItemData(vtcb.AddString("double"), ValueType_double);
vtcb.SetItemData(vtcb.AddString("string"), ValueType_string);
vtcb.SetItemData(vtcb.AddString(L"int8"), ValueType_int8);
vtcb.SetItemData(vtcb.AddString(L"int16"), ValueType_int16);
vtcb.SetItemData(vtcb.AddString(L"int32"), ValueType_int32);
vtcb.SetItemData(vtcb.AddString(L"int64"), ValueType_int64);
vtcb.SetItemData(vtcb.AddString(L"float"), ValueType_float);
vtcb.SetItemData(vtcb.AddString(L"double"), ValueType_double);
vtcb.SetItemData(vtcb.AddString(L"string"), ValueType_string);
vtcb.SetCurSel(0);
m_ResultsListCtrl.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_ResultsListCtrl.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
m_ResultsListCtrl.AddColumn("Address", ResultsListCtrl_Col_Address);
m_ResultsListCtrl.AddColumn("Value", ResultsListCtrl_Col_Value);
m_ResultsListCtrl.AddColumn("Previous", ResultsListCtrl_Col_Previous);
m_ResultsListCtrl.AddColumn(L"Address", ResultsListCtrl_Col_Address);
m_ResultsListCtrl.AddColumn(L"Value", ResultsListCtrl_Col_Value);
m_ResultsListCtrl.AddColumn(L"Previous", ResultsListCtrl_Col_Previous);
m_ResultsListCtrl.SetColumnWidth(ResultsListCtrl_Col_Address, 80);
m_ResultsListCtrl.SetColumnWidth(ResultsListCtrl_Col_Value, 80);
m_ResultsListCtrl.SetColumnWidth(ResultsListCtrl_Col_Previous, 80);
m_WatchListCtrl.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_WatchListCtrl.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
m_WatchListCtrl.AddColumn("Lock", WatchListCtrl_Col_Lock);
m_WatchListCtrl.AddColumn("BP", WatchListCtrl_Col_BP);
m_WatchListCtrl.AddColumn("Address", WatchListCtrl_Col_Address);
m_WatchListCtrl.AddColumn("Description", WatchListCtrl_Col_Description);
m_WatchListCtrl.AddColumn("Type", WatchListCtrl_Col_Type);
m_WatchListCtrl.AddColumn("Value", WatchListCtrl_Col_Value);
m_WatchListCtrl.AddColumn(L"Lock", WatchListCtrl_Col_Lock);
m_WatchListCtrl.AddColumn(L"BP", WatchListCtrl_Col_BP);
m_WatchListCtrl.AddColumn(L"Address", WatchListCtrl_Col_Address);
m_WatchListCtrl.AddColumn(L"Description", WatchListCtrl_Col_Description);
m_WatchListCtrl.AddColumn(L"Type", WatchListCtrl_Col_Type);
m_WatchListCtrl.AddColumn(L"Value", WatchListCtrl_Col_Value);
m_WatchListCtrl.SetColumnWidth(WatchListCtrl_Col_Lock, 35);
m_WatchListCtrl.SetColumnWidth(WatchListCtrl_Col_BP, 35);
m_WatchListCtrl.SetColumnWidth(WatchListCtrl_Col_Address, 80);
@ -533,8 +533,8 @@ LRESULT CDebugMemorySearch::OnResultsPopupSetValue(WORD /*wNotifyCode*/, WORD /*
{
int index = m_ResultsListCtrl.GetItemData(iItem);
CScanResult* presult = m_MemoryScanner.GetResult(index);
char* enteredString = m_SetValueDlg.GetEnteredString();
presult->SetMemoryValueFromString(enteredString);
wchar_t* enteredString = m_SetValueDlg.GetEnteredString();
presult->SetMemoryValueFromString(stdstr().FromUTF16(enteredString).c_str());
m_ResultsListCtrl.SetItemText(iItem, ResultsListCtrl_Col_Value, enteredString);
}
}
@ -672,11 +672,11 @@ LRESULT CDebugMemorySearch::OnWatchListDblClick(LPNMHDR /*lpnmh*/)
{
if (m_SetValueDlg.DoModal("Change address", "New address:", stdstr_f("0x%08X", presult->m_Address).c_str()))
{
char* szEnteredString = m_SetValueDlg.GetEnteredString();
uint32_t newAddr = strtoul(szEnteredString, NULL, 0);
std::string szEnteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
uint32_t newAddr = strtoul(szEnteredString.c_str(), NULL, 0);
if (presult->SetAddressSafe(newAddr))
{
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Address, stdstr_f("0x%08X", newAddr).c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Address, stdstr_f("0x%08X", newAddr).ToUTF16().c_str());
}
}
}
@ -687,7 +687,7 @@ LRESULT CDebugMemorySearch::OnWatchListDblClick(LPNMHDR /*lpnmh*/)
presult->GetMemoryValueString(szInitialValue, 1024);
if (m_SetValueDlg.DoModal("Change value", "New value:", szInitialValue))
{
presult->SetMemoryValueFromString(m_SetValueDlg.GetEnteredString());
presult->SetMemoryValueFromString(stdstr().FromUTF16(m_SetValueDlg.GetEnteredString()).c_str());
}
}
break;
@ -695,9 +695,9 @@ LRESULT CDebugMemorySearch::OnWatchListDblClick(LPNMHDR /*lpnmh*/)
{
if (m_SetValueDlg.DoModal("Set description", "New description:", presult->GetDescription()))
{
char* szEnteredString = m_SetValueDlg.GetEnteredString();
presult->SetDescription(szEnteredString);
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Description, szEnteredString);
stdstr szEnteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
presult->SetDescription(szEnteredString.c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Description, stdstr(szEnteredString).ToUTF16().c_str());
}
}
break;
@ -712,16 +712,16 @@ LRESULT CDebugMemorySearch::OnWatchListDblClick(LPNMHDR /*lpnmh*/)
{
if (m_SetValueDlg.DoModal("String length", "New string length:", stdstr_f("%d", presult->GetStrLength()).c_str()))
{
const char* enteredString = m_SetValueDlg.GetEnteredString();
int length = atoi(enteredString);
stdstr enteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
int length = atoi(enteredString.c_str());
presult->SetStrLengthSafe(length);
}
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type, stdstr_f("char[%d]", presult->GetStrLength()).c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type, stdstr_f("char[%d]", presult->GetStrLength()).ToUTF16().c_str());
}
else
{
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type, presult->GetTypeName());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type, stdstr(presult->GetTypeName()).ToUTF16().c_str());
}
}
}
@ -906,10 +906,10 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeValue(WORD /*wNotifyCode*/, WO
{
int index = m_WatchListCtrl.GetItemData(iItem);
CScanResult* presult = &m_WatchList[index];
char* enteredString = m_SetValueDlg.GetEnteredString();
stdstr enteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
// todo prompt for size change if string is too long
presult->SetMemoryValueFromString(enteredString);
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Value, enteredString);
presult->SetMemoryValueFromString(enteredString.c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Value, stdstr(enteredString).ToUTF16().c_str());
}
}
}
@ -937,9 +937,9 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeDescription(WORD /*wNotifyCode
{
int index = m_WatchListCtrl.GetItemData(iItem);
CScanResult* presult = &m_WatchList[index];
char* description = m_SetValueDlg.GetEnteredString();
presult->SetDescription(description);
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Description, description);
stdstr description = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
presult->SetDescription(description.c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Description, description.ToUTF16().c_str());
}
}
}
@ -966,8 +966,8 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeType(WORD /*wNotifyCode*/, WOR
if (m_SetValueDlg.DoModal("String length", "New string length:",
stdstr_f("%d", pFirstResult->GetStrLength()).c_str()))
{
const char* enteredString = m_SetValueDlg.GetEnteredString();
length = atoi(enteredString);
stdstr enteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
length = atoi(enteredString.c_str());
if (length <= 0)
{
@ -991,11 +991,11 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeType(WORD /*wNotifyCode*/, WOR
presult->SetStrLengthSafe(length);
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type,
stdstr_f("char[%d]", presult->GetStrLength()).c_str());
stdstr_f("char[%d]", presult->GetStrLength()).ToUTF16().c_str());
}
else
{
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type, presult->GetTypeName());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Type, stdstr(presult->GetTypeName()).ToUTF16().c_str());
}
}
}
@ -1015,8 +1015,8 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeAddress(WORD /*wNotifyCode*/,
if (m_SetValueDlg.DoModal("Change address", "New address:", stdstr_f("0x%08X", pFirstResult->m_Address).c_str()))
{
char* enteredString = m_SetValueDlg.GetEnteredString();
uint32_t newAddr = strtoul(enteredString, NULL, 0);
stdstr enteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
uint32_t newAddr = strtoul(enteredString.c_str(), NULL, 0);
stdstr newAddrStr = stdstr_f("0x%08X", newAddr);
int nItems = m_WatchListCtrl.GetItemCount();
@ -1029,7 +1029,7 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeAddress(WORD /*wNotifyCode*/,
int index = m_WatchListCtrl.GetItemData(iItem);
CScanResult* presult = &m_WatchList[index];
presult->SetAddressSafe(newAddr);
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Address, newAddrStr.c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Address, newAddrStr.ToUTF16().c_str());
}
}
}
@ -1048,8 +1048,8 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeAddressBy(WORD /*wNotifyCode*/
if (m_SetValueDlg.DoModal("Adjust address", "Address offset (+/-):", "0"))
{
char* szEnteredString = m_SetValueDlg.GetEnteredString();
int offset = atoi(szEnteredString);
stdstr szEnteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
int offset = atoi(szEnteredString.c_str());
int nItems = m_WatchListCtrl.GetItemCount();
for (int iItem = 0; iItem < nItems; iItem++)
@ -1064,7 +1064,7 @@ LRESULT CDebugMemorySearch::OnWatchListPopupChangeAddressBy(WORD /*wNotifyCode*/
if (presult->SetAddressSafe(newAddr))
{
stdstr newAddrStr = stdstr_f("0x%08X", presult->m_Address);
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Address, newAddrStr.c_str());
m_WatchListCtrl.SetItemText(iItem, WatchListCtrl_Col_Address, newAddrStr.ToUTF16().c_str());
}
}
}
@ -1666,7 +1666,7 @@ void CDebugMemorySearch::Search(void)
m_MemoryScanner.SetStringValueLength(stringValueLength);
break;
default:
MessageBox("Unimplemented value type", "Unimplemented", MB_OK);
MessageBox(L"Unimplemented value type", L"Unimplemented", MB_OK);
return;
}
}
@ -1678,7 +1678,7 @@ void CDebugMemorySearch::Search(void)
if (!bAddressRangeValid)
{
MessageBox("Invalid address range", "Invalid address range");
MessageBox(L"Invalid address range", L"Invalid address range");
return;
}
@ -1699,7 +1699,7 @@ void CDebugMemorySearch::Search(void)
return;
value_parse_error:
MessageBox("Invalid value", "Invalid value", MB_OK);
MessageBox(L"Invalid value", L"Invalid value", MB_OK);
return;
}
@ -1730,11 +1730,11 @@ void CDebugMemorySearch::UpdateOptions(void)
CComboBox & cb = m_SearchTypeOptions;
cb.ResetContent();
cb.SetItemData(cb.AddString("Exact value"), SearchType_ExactValue);
cb.SetItemData(cb.AddString("Unknown initial value"), SearchType_UnknownValue);
cb.SetItemData(cb.AddString("Greater than..."), SearchType_GreaterThanValue);
cb.SetItemData(cb.AddString("Less than..."), SearchType_LessThanValue);
cb.SetItemData(cb.AddString("JAL to..."), SearchType_JalTo);
cb.SetItemData(cb.AddString(L"Exact value"), SearchType_ExactValue);
cb.SetItemData(cb.AddString(L"Unknown initial value"), SearchType_UnknownValue);
cb.SetItemData(cb.AddString(L"Greater than..."), SearchType_GreaterThanValue);
cb.SetItemData(cb.AddString(L"Less than..."), SearchType_LessThanValue);
cb.SetItemData(cb.AddString(L"JAL to..."), SearchType_JalTo);
cb.SetCurSel(0);
if (valueType == ValueType_string)
@ -1750,13 +1750,13 @@ void CDebugMemorySearch::UpdateOptions(void)
{
CComboBox & cb = m_SearchTypeOptions;
cb.ResetContent();
cb.SetItemData(cb.AddString("Exact value"), SearchType_ExactValue);
cb.SetItemData(cb.AddString("Changed value"), SearchType_ChangedValue);
cb.SetItemData(cb.AddString("Unchanged value"), SearchType_UnchangedValue);
cb.SetItemData(cb.AddString("Greater than..."), SearchType_GreaterThanValue);
cb.SetItemData(cb.AddString("Less than..."), SearchType_LessThanValue);
cb.SetItemData(cb.AddString("Increased value"), SearchType_IncreasedValue);
cb.SetItemData(cb.AddString("Decreased value"), SearchType_DecreasedValue);
cb.SetItemData(cb.AddString(L"Exact value"), SearchType_ExactValue);
cb.SetItemData(cb.AddString(L"Changed value"), SearchType_ChangedValue);
cb.SetItemData(cb.AddString(L"Unchanged value"), SearchType_UnchangedValue);
cb.SetItemData(cb.AddString(L"Greater than..."), SearchType_GreaterThanValue);
cb.SetItemData(cb.AddString(L"Less than..."), SearchType_LessThanValue);
cb.SetItemData(cb.AddString(L"Increased value"), SearchType_IncreasedValue);
cb.SetItemData(cb.AddString(L"Decreased value"), SearchType_DecreasedValue);
cb.SetCurSel(0);
if (m_bJalSelected)
@ -1835,9 +1835,9 @@ void CDebugMemorySearch::UpdateResultsList(bool bUpdateScrollbar, bool bResetScr
presult->GetMemoryValueString(szCurrentValue, 1024);
presult->GetValueString(szValue, 1024);
m_ResultsListCtrl.AddItem(nItem, ResultsListCtrl_Col_Address, szAddress);
m_ResultsListCtrl.SetItemText(nItem, ResultsListCtrl_Col_Value, szCurrentValue);
m_ResultsListCtrl.SetItemText(nItem, ResultsListCtrl_Col_Previous, szValue);
m_ResultsListCtrl.AddItem(nItem, ResultsListCtrl_Col_Address, stdstr(szAddress).ToUTF16().c_str());
m_ResultsListCtrl.SetItemText(nItem, ResultsListCtrl_Col_Value, stdstr(szCurrentValue).ToUTF16().c_str());
m_ResultsListCtrl.SetItemText(nItem, ResultsListCtrl_Col_Previous, stdstr(szValue).ToUTF16().c_str());
m_ResultsListCtrl.SetItemData(nItem, index);
nItem++;
@ -1902,12 +1902,12 @@ void CDebugMemorySearch::UpdateWatchList(bool bUpdateScrollbar)
break;
}
m_WatchListCtrl.AddItem(nItem, WatchListCtrl_Col_Lock, "");
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_BP, "");
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Address, szAddress);
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Description, pSzDescription);
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Type, pSzValueType);
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Value, szValue);
m_WatchListCtrl.AddItem(nItem, WatchListCtrl_Col_Lock, L"");
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_BP, L"");
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Address, stdstr(szAddress).ToUTF16().c_str());
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Description, stdstr(pSzDescription).ToUTF16().c_str());
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Type, stdstr(pSzValueType).ToUTF16().c_str());
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Value, stdstr(szValue).ToUTF16().c_str());
m_WatchListCtrl.SetItemData(nItem, index);
//if (presult->IsSelected())
@ -1948,7 +1948,7 @@ void CDebugMemorySearch::RefreshResultsListValues(void)
char szCurrentValue[1024];
presult->GetMemoryValueString(szCurrentValue, 1024);
m_ResultsListCtrl.SetItemText(nItem, ResultsListCtrl_Col_Value, szCurrentValue);
m_ResultsListCtrl.SetItemText(nItem, ResultsListCtrl_Col_Value, stdstr(szCurrentValue).ToUTF16().c_str());
}
m_ResultsListCtrl.SetRedraw(TRUE);
@ -1989,9 +1989,9 @@ void CDebugMemorySearch::RefreshWatchListValues(void)
char szCurrentValue[1024];
presult->GetMemoryValueString(szCurrentValue, 1024);
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Lock, (bHaveLock ? "X" : ""));
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_BP, szBPStates);
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Value, szCurrentValue);
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Lock, (bHaveLock ? L"X" : L""));
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_BP, stdstr(szBPStates).ToUTF16().c_str());
m_WatchListCtrl.SetItemText(nItem, WatchListCtrl_Col_Value, stdstr(szCurrentValue).ToUTF16().c_str());
}
m_WatchListCtrl.SetRedraw(TRUE);
@ -2198,7 +2198,7 @@ INT_PTR CSetValueDlg::DoModal(const char* caption, const char* label, DWORD_PTR
return CDialogImpl<CSetValueDlg>::DoModal();
}
char* CSetValueDlg::GetEnteredString(void)
wchar_t* CSetValueDlg::GetEnteredString(void)
{
return m_EnteredString;
}
@ -2215,18 +2215,18 @@ DWORD_PTR CSetValueDlg::GetEnteredData(void)
LRESULT CSetValueDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
SetWindowText(m_Caption);
SetWindowText(stdstr(m_Caption).ToUTF16().c_str());
CenterWindow();
m_Value.Attach(GetDlgItem(IDC_EDIT_VALUE));
m_CmbValue.Attach(GetDlgItem(IDC_CMB_VALUE));
m_Prompt.Attach(GetDlgItem(IDC_LBL_PROMPT));
m_Prompt.SetWindowText(m_Label);
m_Prompt.SetWindowText(stdstr(m_Label).ToUTF16().c_str());
if (m_Mode == Mode_TextBox)
{
m_CmbValue.ShowWindow(SW_HIDE);
m_Value.SetWindowTextA(m_InitialText);
m_Value.SetWindowText(stdstr(m_InitialText).ToUTF16().c_str());
m_Value.SetFocus();
m_Value.SetSelAll();
}
@ -2236,7 +2236,7 @@ LRESULT CSetValueDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lP
for (int i = 0; m_ComboItems[i].str != NULL; i++)
{
int idx = m_CmbValue.AddString(m_ComboItems[i].str);
int idx = m_CmbValue.AddString(stdstr(m_ComboItems[i].str).ToUTF16().c_str());
m_CmbValue.SetItemData(idx, m_ComboItems[i].data);
if (m_ComboItems[i].data == m_InitialData)
{
@ -2267,13 +2267,13 @@ LRESULT CSetValueDlg::OnOK(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BO
if (m_Mode == Mode_TextBox)
{
int length = m_Value.GetWindowTextLength();
m_EnteredString = new char[length + 1];
m_EnteredString = new wchar_t[length + 1];
m_Value.GetWindowText(m_EnteredString, length + 1);
}
else if (m_Mode == Mode_ComboBox)
{
int length = m_CmbValue.GetWindowTextLength();
m_EnteredString = new char[length + 1];
m_EnteredString = new wchar_t[length + 1];
m_CmbValue.GetWindowText(m_EnteredString, length + 1);
m_EnteredData = m_CmbValue.GetItemData(m_CmbValue.GetCurSel());
@ -2335,7 +2335,7 @@ void CEditMixed::ReloadString(void)
}
m_StringLength = GetWindowTextLength();
m_String = (char*) malloc(m_StringLength + 1);
m_String = (wchar_t*) malloc(m_StringLength + 1);
GetWindowText(m_String, m_StringLength + 1);
}
@ -2448,7 +2448,7 @@ bool CEditMixed::GetValue(uint64_t& value)
ReloadString();
char *end;
uint64_t res = strtoull(m_String, &end, m_DisplayFormat == DisplayHex ? 16 : 10);
uint64_t res = strtoull(stdstr().FromUTF16(m_String).c_str(), &end, m_DisplayFormat == DisplayHex ? 16 : 10);
if (*end != '\0')
{
@ -2469,7 +2469,7 @@ bool CEditMixed::GetValue(int64_t& value)
ReloadString();
char *end;
uint64_t res = strtoll(m_String, &end, m_DisplayFormat == DisplayHex ? 16 : 10);
uint64_t res = strtoll(stdstr().FromUTF16(m_String).c_str(), &end, m_DisplayFormat == DisplayHex ? 16 : 10);
if (*end != '\0')
{
@ -2492,7 +2492,7 @@ bool CEditMixed::GetValue(float& value)
float valueF32;
char *end;
valueF32 = strtof(m_String, &end);
valueF32 = strtof(stdstr().FromUTF16(m_String).c_str(), &end);
if (*end != '\0')
{
@ -2515,7 +2515,7 @@ bool CEditMixed::GetValue(double& value)
double valueF64;
char *end;
valueF64 = strtod(m_String, &end);
valueF64 = strtod(stdstr().FromUTF16(m_String).c_str(), &end);
if (*end != '\0')
{
@ -2549,19 +2549,24 @@ bool CEditMixed::GetValueHexString(const char*& value, int& length)
return false;
}
int numBytes = CMemoryScanner::ParseHexString(NULL, m_String);
stdstr string = stdstr().FromUTF16(m_String);
int numBytes = CMemoryScanner::ParseHexString(NULL, string.c_str());
if (numBytes == 0)
{
return false;
}
char *hexString = (char*) malloc(numBytes);
CMemoryScanner::ParseHexString(hexString, m_String);
char *hexString = (char*)malloc(numBytes);
CMemoryScanner::ParseHexString(hexString, string.c_str());
wchar_t *wchexString = (wchar_t*)malloc(numBytes * sizeof(wchar_t));
wcscpy(wchexString, stdstr(hexString).ToUTF16().c_str());
free(hexString);
free(m_String);
m_String = hexString;
m_String = wchexString;
m_StringLength = numBytes;
value = (const char*)m_String;

View File

@ -20,7 +20,7 @@ class CEditMixed :
private:
ValueType m_Type;
DisplayFormat m_DisplayFormat;
char *m_String;
wchar_t *m_String;
int m_StringLength;
void ReloadString(void);
@ -68,7 +68,7 @@ public:
INT_PTR DoModal(const char* caption, const char* label, const char* initialText);
INT_PTR DoModal(const char* caption, const char* label, DWORD_PTR initialData, const ComboItem items[]);
char* GetEnteredString(void);
wchar_t* GetEnteredString(void);
DWORD_PTR GetEnteredData(void);
CSetValueDlg(void);
@ -88,7 +88,7 @@ private:
const ComboItem* m_ComboItems;
const char* m_InitialText;
char *m_EnteredString;
wchar_t *m_EnteredString;
DWORD_PTR m_InitialData;
DWORD_PTR m_EnteredData;

View File

@ -166,7 +166,7 @@ void CRegisterTabs::RefreshEdits()
cause.intval = g_Reg->CAUSE_REGISTER;
const char* szExceptionCode = ExceptionCodes[cause.exceptionCode];
m_CauseTip.SetWindowTextA(szExceptionCode);
m_CauseTip.SetWindowText(stdstr(szExceptionCode).ToUTF16().c_str());
m_RDRAMEdits[0].SetValue(g_Reg->RDRAM_CONFIG_REG, DisplayMode::ZeroExtend); // or device type
m_RDRAMEdits[1].SetValue(g_Reg->RDRAM_DEVICE_ID_REG, DisplayMode::ZeroExtend);
@ -284,12 +284,12 @@ void CRegisterTabs::RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam)
WORD ctrlId = LOWORD(wParam);
CWindow editCtrl = ::GetDlgItem(hDlg, ctrlId);
char text[20];
wchar_t text[20];
editCtrl.GetWindowText(text, 20);
if (srcTabId == TabGPR)
{
uint64_t value = CEditReg64::ParseValue(text);
uint64_t value = CEditReg64::ParseValue(stdstr().FromUTF16(text).c_str());
if (ctrlId == IDC_HI_EDIT)
{
g_Reg->m_HI.UDW = value;
@ -306,8 +306,8 @@ void CRegisterTabs::RegisterChanged(HWND hDlg, TAB_ID srcTabId, WPARAM wParam)
return;
}
uint32_t value = strtoul(text, NULL, 16);
sprintf(text, "%08X", value);
uint32_t value = wcstoul(text, NULL, 16);
wsprintf(text, L"%08X", value);
editCtrl.SetWindowText(text); // reformat text
if (srcTabId == TabFPR)
@ -456,12 +456,12 @@ INT_PTR CALLBACK CRegisterTabs::TabProcDefault(HWND hDlg, UINT msg, WPARAM wPara
{
if (msg == WM_INITDIALOG)
{
SetProp(hDlg, "attached", (HANDLE)lParam);
SetProp(hDlg, L"attached", (HANDLE)lParam);
return TRUE;
}
if (msg == WM_COMMAND && HIWORD(wParam) == EN_KILLFOCUS)
{
bool * attached = (bool *)GetProp(hDlg, "attached");
bool * attached = (bool *)GetProp(hDlg, L"attached");
if (attached != NULL && *attached)
{
RegisterChanged(hDlg, TabDefault, wParam);
@ -475,7 +475,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L
{
if (msg == WM_INITDIALOG)
{
SetProp(hDlg, "attached", (HANDLE)lParam);
SetProp(hDlg, L"attached", (HANDLE)lParam);
return TRUE;
}
@ -551,7 +551,7 @@ INT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, L
if (msg == WM_COMMAND && HIWORD(wParam) == EN_KILLFOCUS)
{
bool * attached = (bool *)GetProp(hDlg, "attached");
bool * attached = (bool *)GetProp(hDlg, L"attached");
if (attached != NULL && *attached)
{
RegisterChanged(hDlg, TabGPR, wParam);
@ -706,12 +706,12 @@ INT_PTR CALLBACK CRegisterTabs::TabProcFPR(HWND hDlg, UINT msg, WPARAM wParam, L
{
if (msg == WM_INITDIALOG)
{
SetProp(hDlg, "attached", (HANDLE)lParam);
SetProp(hDlg, L"attached", (HANDLE)lParam);
return TRUE;
}
if (msg == WM_COMMAND && HIWORD(wParam) == EN_KILLFOCUS)
{
bool * attached = (bool *)GetProp(hDlg, "attached");
bool * attached = (bool *)GetProp(hDlg, L"attached");
if (attached != NULL && *attached)
{
RegisterChanged(hDlg, TabFPR, wParam);
@ -732,7 +732,7 @@ CRect CRegisterTabs::GetPageRect()
CWindow CRegisterTabs::AddTab(char* caption, int dialogId, DLGPROC dlgProc)
{
AddItem(caption);
AddItem(stdstr(caption).ToUTF16().c_str());
CWindow parentWin = GetParent();
CWindow tabWin = ::CreateDialogParam(NULL, MAKEINTRESOURCE(dialogId), parentWin, dlgProc, (LPARAM)&m_attached);
@ -882,7 +882,7 @@ stdstr CRegisterTabs::CopyTabRegisters(int id)
item.pszText = buffer;
GetItem(id, &item);
str += item.pszText;
str += stdstr().FromUTF16(item.pszText);
const TabRecord *record = nullptr;
switch (id)
@ -959,15 +959,16 @@ stdstr CRegisterTabs::CopyTabRegisters(int id)
}
// CEditReg64 for GPR
uint64_t CEditReg64::ParseValue(char* wordPair)
uint64_t CEditReg64::ParseValue(const char* wordPair)
{
uint32_t a, b;
uint64_t ret;
a = strtoul(wordPair, &wordPair, 16);
if (*wordPair == ' ')
char * end = NULL;
a = strtoul(wordPair, &end, 16);
if (*end == ' ')
{
wordPair++;
b = strtoul(wordPair, NULL, 16);
end++;
b = strtoul(end, NULL, 16);
ret = (uint64_t)a << 32;
ret |= b;
return ret;
@ -1004,9 +1005,9 @@ LRESULT CEditReg64::OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
goto canceled;
}
char text[20];
wchar_t text[20];
GetWindowText(text, 20);
int textLen = strlen(text);
int textLen = wcslen(text);
if (textLen >= 17)
{
@ -1018,7 +1019,7 @@ LRESULT CEditReg64::OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
}
}
if (charCode == ' ' && strchr(text, ' ') != NULL)
if (charCode == ' ' && wcschr(text, ' ') != NULL)
{
goto canceled;
}
@ -1034,9 +1035,9 @@ canceled:
uint64_t CEditReg64::GetValue()
{
char text[20];
wchar_t text[20];
GetWindowText(text, 20);
return ParseValue(text);
return ParseValue(stdstr().FromUTF16(text).c_str());
}
stdstr CEditReg64::GetValueText()
@ -1053,9 +1054,9 @@ LRESULT CEditReg64::OnLostFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPara
void CEditReg64::SetValue(uint32_t h, uint32_t l)
{
char text[20];
sprintf(text, "%08X %08X", h, l);
SetWindowText(text);
stdstr text;
text.Format("%08X %08X", h, l);
SetWindowText(text.ToUTF16().c_str());
}
void CEditReg64::SetValue(uint64_t value)

View File

@ -17,7 +17,7 @@ class CEditReg64 :
private CDebugSettings
{
public:
static uint64_t ParseValue(char* wordPair);
static uint64_t ParseValue(const char* wordPair);
BOOL Attach(HWND hWndNew);
LRESULT OnChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnLostFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

View File

@ -35,13 +35,13 @@ LRESULT CDebugScripts::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
HFONT monoFont = CreateFont(-11, 0, 0, 0,
FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
CLEARTYPE_QUALITY, FF_DONTCARE, "Consolas"
CLEARTYPE_QUALITY, FF_DONTCARE, L"Consolas"
);
m_InstanceInfoEdit.Attach(GetDlgItem(IDC_CTX_INFO_EDIT));
m_ScriptList.Attach(GetDlgItem(IDC_SCRIPT_LIST));
m_ScriptList.AddColumn("Script", 0, 0);
m_ScriptList.AddColumn(L"Script", 0, 0);
m_ScriptList.SetColumnWidth(0, 100);
m_ScriptList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_ScriptList.ModifyStyle(LVS_OWNERDRAWFIXED, 0, 0);
@ -79,7 +79,7 @@ void CDebugScripts::ConsolePrint(const char* text)
m_ConsoleEdit.SetRedraw(FALSE);
m_ConsoleEdit.AppendText(text);
m_ConsoleEdit.AppendText(stdstr(text).ToUTF16().c_str());
m_ConsoleEdit.SetRedraw(TRUE);
@ -107,7 +107,7 @@ void CDebugScripts::RefreshConsole()
void CDebugScripts::ConsoleClear()
{
m_ConsoleEdit.SetWindowTextA("");
m_ConsoleEdit.SetWindowText(L"");
}
void CDebugScripts::ConsoleCopy()
@ -119,12 +119,12 @@ void CDebugScripts::ConsoleCopy()
EmptyClipboard();
size_t nChars = m_ConsoleEdit.GetWindowTextLengthA() + 1;
size_t nChars = m_ConsoleEdit.GetWindowTextLength() + 1;
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, nChars);
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, nChars * sizeof(wchar_t));
char* memBuf = (char*)GlobalLock(hMem);
m_ConsoleEdit.GetWindowTextA(memBuf, nChars);
wchar_t* memBuf = (wchar_t*)GlobalLock(hMem);
m_ConsoleEdit.GetWindowText(memBuf, nChars);
GlobalUnlock(hMem);
SetClipboardData(CF_TEXT, hMem);
@ -152,7 +152,7 @@ void CDebugScripts::RefreshList()
do
{
stdstr scriptFileName = SearchPath.GetNameExtension();
m_ScriptList.AddItem(0, 0, scriptFileName.c_str());
m_ScriptList.AddItem(0, 0, scriptFileName.ToUTF16().c_str());
} while (SearchPath.FindNext());
m_ScriptList.SetRedraw(true);
@ -220,7 +220,7 @@ void CDebugScripts::RefreshStatus()
stdstr instanceInfo = stdstr_f("%s (%s)", m_SelectedScriptName, szState);
m_InstanceInfoEdit.SetWindowTextA(instanceInfo.c_str());
m_InstanceInfoEdit.SetWindowText(instanceInfo.ToUTF16().c_str());
if (state == STATE_RUNNING)
{
@ -238,7 +238,9 @@ LRESULT CDebugScripts::OnScriptListClicked(NMHDR* pNMHDR)
NMITEMACTIVATE* pIA = reinterpret_cast<NMITEMACTIVATE*>(pNMHDR);
int nItem = pIA->iItem;
m_ScriptList.GetItemText(nItem, 0, m_SelectedScriptName, MAX_PATH);
wchar_t ScriptName[MAX_PATH];
m_ScriptList.GetItemText(nItem, 0, ScriptName, MAX_PATH);
strcpy(m_SelectedScriptName, stdstr().FromUTF16(ScriptName).c_str());
RefreshStatus();
@ -288,10 +290,10 @@ LRESULT CDebugScripts::OnScriptListCustomDraw(NMHDR* pNMHDR)
DWORD nItem = pLVCD->nmcd.dwItemSpec;
char scriptName[MAX_PATH];
wchar_t scriptName[MAX_PATH];
m_ScriptList.GetItemText(nItem, 0, scriptName, MAX_PATH);
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(scriptName);
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(stdstr("").FromUTF16(scriptName).c_str());
if (state == STATE_STARTED)
{
@ -305,7 +307,7 @@ LRESULT CDebugScripts::OnScriptListCustomDraw(NMHDR* pNMHDR)
return CDRF_DODEFAULT;
}
void CDebugScripts::EvaluateInSelectedInstance(char* code)
void CDebugScripts::EvaluateInSelectedInstance(const char* code)
{
INSTANCE_STATE state = m_Debugger->ScriptSystem()->GetInstanceState(m_SelectedScriptName);
@ -324,9 +326,9 @@ LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BO
{
if (m_HistoryIdx > 0)
{
char* code = m_History[--m_HistoryIdx];
SetWindowTextA(code);
int selEnd = strlen(code);
wchar_t* code = m_History[--m_HistoryIdx];
SetWindowText(code);
int selEnd = wcslen(code);
SetSel(selEnd, selEnd);
}
}
@ -335,14 +337,14 @@ LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BO
int size = m_History.size();
if (m_HistoryIdx < size - 1)
{
char* code = m_History[++m_HistoryIdx];
SetWindowTextA(code);
int selEnd = strlen(code);
wchar_t* code = m_History[++m_HistoryIdx];
SetWindowText(code);
int selEnd = wcslen(code);
SetSel(selEnd, selEnd);
}
else if (m_HistoryIdx < size)
{
SetWindowTextA("");
SetWindowText(L"");
m_HistoryIdx++;
}
}
@ -355,18 +357,18 @@ LRESULT CEditEval::OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BO
}
size_t codeLength = GetWindowTextLength() + 1;
char* code = (char*)malloc(codeLength);
GetWindowTextA(code, codeLength);
wchar_t* code = (wchar_t*)malloc(codeLength * sizeof(wchar_t));
GetWindowText(code, codeLength);
m_ScriptWindow->EvaluateInSelectedInstance(code);
m_ScriptWindow->EvaluateInSelectedInstance(stdstr().FromUTF16(code).c_str());
SetWindowTextA("");
SetWindowText(L"");
int historySize = m_History.size();
// remove duplicate
for (int i = 0; i < historySize; i++)
{
if (strcmp(code, m_History[i]) == 0)
if (wcscmp(code, m_History[i]) == 0)
{
free(m_History[i]);
m_History.erase(m_History.begin() + i);
@ -426,5 +428,5 @@ void CDebugScripts::ToggleSelected()
void CDebugScripts::EditSelected()
{
ShellExecute(NULL, "edit", m_SelectedScriptName, NULL, "Scripts", SW_SHOWNORMAL);
ShellExecute(NULL, L"edit", stdstr(m_SelectedScriptName).ToUTF16().c_str(), NULL, L"Scripts", SW_SHOWNORMAL);
}

View File

@ -25,7 +25,7 @@ class CEditEval : public CWindowImpl<CEditEval, CEdit>
private:
//static char* m_EvalString;
static const int HISTORY_MAX_ENTRIES = 20;
vector<char*> m_History;
vector<wchar_t*> m_History;
int m_HistoryIdx;
CDebugScripts* m_ScriptWindow;
@ -104,7 +104,7 @@ public:
void RefreshList();
void RefreshConsole();
void EvaluateInSelectedInstance(char* code);
void EvaluateInSelectedInstance(const char* code);
void RunSelected();
void StopSelected();
void ToggleSelected();

View File

@ -30,10 +30,9 @@ LRESULT CDebugStackTrace::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
DlgSavePos_Init(DebuggerUI_StackTracePos);
m_List.Attach(GetDlgItem(IDC_STACKTRACE_LIST));
m_List.AddColumn("Caller", 0);
m_List.AddColumn("Routine", 1);
m_List.AddColumn("Name", 2);
m_List.AddColumn(L"Caller", 0);
m_List.AddColumn(L"Routine", 1);
m_List.AddColumn(L"Name", 2);
m_List.SetColumnWidth(0, 70);
m_List.SetColumnWidth(1, 70);
@ -93,7 +92,7 @@ void CDebugStackTrace::Refresh()
return;
}
SetWindowText(stdstr_f("Stack Trace (%d)", m_EntriesIndex).c_str());
SetWindowText(stdstr_f("Stack Trace (%d)", m_EntriesIndex).ToUTF16().c_str());
m_List.SetRedraw(FALSE);
m_List.DeleteAllItems();
@ -103,22 +102,17 @@ void CDebugStackTrace::Refresh()
uint32_t routineAddress = m_Entries[i].routineAddress;
uint32_t callingAddress = m_Entries[i].callingAddress;
char szAddress[9];
sprintf(szAddress, "%08X", callingAddress);
m_List.AddItem(i, 0, szAddress);
sprintf(szAddress, "%08X", routineAddress);
m_List.AddItem(i, 1, szAddress);
m_List.AddItem(i, 0, stdstr_f("%08X", callingAddress).ToUTF16().c_str());
m_List.AddItem(i, 1, stdstr_f("%08X", routineAddress).ToUTF16().c_str());
CSymbol symbol;
if (m_Debugger->SymbolTable()->GetSymbolByAddress(routineAddress, &symbol))
{
m_List.AddItem(i, 2, symbol.m_Name);
m_List.AddItem(i, 2, stdstr(symbol.m_Name).ToUTF16().c_str());
}
else
{
m_List.AddItem(i, 2, "");
m_List.AddItem(i, 2, L"");
}
m_List.SetItemData(i, routineAddress);

View File

@ -29,11 +29,11 @@ LRESULT CDebugStackView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /
m_StackList.Attach(GetDlgItem(IDC_STACK_LIST));
m_StackList.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_StackList.AddColumn("#", 0);
m_StackList.AddColumn("00", 1);
m_StackList.AddColumn("04", 2);
m_StackList.AddColumn("08", 3);
m_StackList.AddColumn("0C", 4);
m_StackList.AddColumn(L"#", 0);
m_StackList.AddColumn(L"00", 1);
m_StackList.AddColumn(L"04", 2);
m_StackList.AddColumn(L"08", 3);
m_StackList.AddColumn(L"0C", 4);
m_StackList.SetColumnWidth(0, 22);
m_StackList.SetColumnWidth(1, 64);
@ -89,12 +89,12 @@ void CDebugStackView::Refresh()
m_StackList.DeleteAllItems();
uint32_t spBase = g_Reg->m_GPR[29].UW[0];
m_SPStatic.SetWindowTextA(stdstr_f("SP: %08X", spBase).c_str());
m_SPStatic.SetWindowText(stdstr_f("SP: %08X", spBase).ToUTF16().c_str());
for (int i = 0; i < 0x10; i++)
{
char t[4];
sprintf(t, "%02X", i * 0x10);
wchar_t t[4];
swprintf(t, L"%02X", i * 0x10);
m_StackList.AddItem(i, 0, t);
for (int j = 0; j < 4; j++)
@ -104,12 +104,12 @@ void CDebugStackView::Refresh()
if (!m_Debugger->DebugLoad_VAddr(vaddr, val))
{
m_StackList.AddItem(i, j + 1, "????????");
m_StackList.AddItem(i, j + 1, L"????????");
continue;
}
char valStr[9];
sprintf(valStr, "%08X", val);
wchar_t valStr[9];
wsprintf(valStr, L"%08X", val);
m_StackList.AddItem(i, j + 1, valStr);
}
}

View File

@ -48,11 +48,11 @@ LRESULT CDebugSymbols::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*l
m_SymbolsListView.Attach(GetDlgItem(IDC_SYMBOLS_LIST));
m_SymbolsListView.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
m_SymbolsListView.AddColumn("Address", 0);
m_SymbolsListView.AddColumn("Type", 1);
m_SymbolsListView.AddColumn("Name", 2);
m_SymbolsListView.AddColumn("Value", 3);
m_SymbolsListView.AddColumn("Description", 4);
m_SymbolsListView.AddColumn(L"Address", 0);
m_SymbolsListView.AddColumn(L"Type", 1);
m_SymbolsListView.AddColumn(L"Name", 2);
m_SymbolsListView.AddColumn(L"Value", 3);
m_SymbolsListView.AddColumn(L"Description", 4);
m_SymbolsListView.SetColumnWidth(0, 70);
m_SymbolsListView.SetColumnWidth(1, 40);
@ -186,52 +186,54 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR)
case SymbolsListView_Col_Name:
if (m_SetValueDlg.DoModal("Set name", "New name:", symbol.m_Name))
{
char* szEnteredString = m_SetValueDlg.GetEnteredString();
wchar_t* szEnteredString = m_SetValueDlg.GetEnteredString();
m_Debugger->SymbolTable()->RemoveSymbolById(id);
m_Debugger->SymbolTable()->AddSymbol(symbol.m_Type, symbol.m_Address, szEnteredString, symbol.m_Description);
m_Debugger->SymbolTable()->AddSymbol(symbol.m_Type, symbol.m_Address, stdstr().FromUTF16(szEnteredString).c_str(), symbol.m_Description);
}
break;
case SymbolsListView_Col_Value:
char szValue[256];
char* x;
char* y;
const char* x;
const char* y;
m_Debugger->SymbolTable()->GetValueString(szValue, &symbol);
if (m_SetValueDlg.DoModal("Change value", "New value:", szValue))
{
stdstr EnteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
switch (symbol.m_Type)
{
case SYM_U8:
m_Debugger->DebugStore_VAddr<uint8_t>(symbol.m_Address, atoi(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<uint8_t>(symbol.m_Address, atoi(EnteredString.c_str()));
break;
case SYM_U16:
m_Debugger->DebugStore_VAddr<uint16_t>(symbol.m_Address, atoi(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<uint16_t>(symbol.m_Address, atoi(EnteredString.c_str()));
break;
case SYM_U32:
m_Debugger->DebugStore_VAddr<uint32_t>(symbol.m_Address, atoi(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<uint32_t>(symbol.m_Address, atoi(EnteredString.c_str()));
break;
case SYM_U64:
m_Debugger->DebugStore_VAddr<uint64_t>(symbol.m_Address, atoll(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<uint64_t>(symbol.m_Address, atoll(EnteredString.c_str()));
break;
case SYM_S8:
m_Debugger->DebugStore_VAddr<int8_t>(symbol.m_Address, atoi(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<int8_t>(symbol.m_Address, atoi(EnteredString.c_str()));
break;
case SYM_S16:
m_Debugger->DebugStore_VAddr<int16_t>(symbol.m_Address, atoi(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<int16_t>(symbol.m_Address, atoi(EnteredString.c_str()));
break;
case SYM_S32:
m_Debugger->DebugStore_VAddr<int>(symbol.m_Address, atoi(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<int>(symbol.m_Address, atoi(EnteredString.c_str()));
break;
case SYM_S64:
m_Debugger->DebugStore_VAddr<int64_t>(symbol.m_Address, atoll(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<int64_t>(symbol.m_Address, atoll(EnteredString.c_str()));
break;
case SYM_FLOAT:
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address, atof(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address, atof(EnteredString.c_str()));
break;
case SYM_DOUBLE:
m_Debugger->DebugStore_VAddr<double>(symbol.m_Address, atof(m_SetValueDlg.GetEnteredString()));
m_Debugger->DebugStore_VAddr<double>(symbol.m_Address, atof(EnteredString.c_str()));
break;
case SYM_VECTOR2:
x = m_SetValueDlg.GetEnteredString();
x = EnteredString.c_str();
y = strchr(x, ',');
memcpy(szValue, x, y - x);
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address, atof(szValue));
@ -241,7 +243,7 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR)
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address + sizeof(float), atof(szValue));
break;
case SYM_VECTOR3:
x = m_SetValueDlg.GetEnteredString();
x = EnteredString.c_str();
y = strchr(x, ',');
memcpy(szValue, x, y - x);
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address, atof(szValue));
@ -256,7 +258,7 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR)
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address + (sizeof(float) * 2), atof(szValue));
break;
case SYM_VECTOR4:
x = m_SetValueDlg.GetEnteredString();
x = EnteredString.c_str();
y = strchr(x, ',');
memcpy(szValue, x, y - x);
m_Debugger->DebugStore_VAddr<float>(symbol.m_Address, atof(szValue));
@ -281,9 +283,9 @@ LRESULT CDebugSymbols::OnListDblClicked(NMHDR* pNMHDR)
case SymbolsListView_Col_Description:
if (m_SetValueDlg.DoModal("Set description", "New description:", symbol.m_Description))
{
char* szEnteredString = m_SetValueDlg.GetEnteredString();
stdstr szEnteredString = stdstr().FromUTF16(m_SetValueDlg.GetEnteredString());
m_Debugger->SymbolTable()->RemoveSymbolById(id);
m_Debugger->SymbolTable()->AddSymbol(symbol.m_Type, symbol.m_Address, symbol.m_Name, szEnteredString);
m_Debugger->SymbolTable()->AddSymbol(symbol.m_Type, symbol.m_Address, symbol.m_Name, szEnteredString.c_str());
}
break;
}
@ -313,11 +315,11 @@ void CDebugSymbols::Refresh()
stdstr strAddr = stdstr_f("%08X", symbol.m_Address);
m_SymbolsListView.AddItem(nItem, 0, strAddr.c_str());
m_SymbolsListView.AddItem(nItem, 1, symbol.TypeName());
m_SymbolsListView.AddItem(nItem, 2, symbol.m_Name);
m_SymbolsListView.AddItem(nItem, 4, symbol.m_Description);
m_SymbolsListView.AddItem(nItem, 5, szValue);
m_SymbolsListView.AddItem(nItem, 0, strAddr.ToUTF16().c_str());
m_SymbolsListView.AddItem(nItem, 1, stdstr(symbol.TypeName()).ToUTF16().c_str());
m_SymbolsListView.AddItem(nItem, 2, stdstr(symbol.m_Name).ToUTF16().c_str());
m_SymbolsListView.AddItem(nItem, 4, stdstr(symbol.m_Description).ToUTF16().c_str());
m_SymbolsListView.AddItem(nItem, 5, stdstr(szValue).ToUTF16().c_str());
m_SymbolsListView.SetItemData(nItem, symbol.m_Id);
nItem++;
@ -349,6 +351,6 @@ void CDebugSymbols::RefreshValues()
char szValue[256];
m_Debugger->SymbolTable()->GetValueString(szValue, &symbol);
m_SymbolsListView.SetItemText(i, 3, szValue);
m_SymbolsListView.SetItemText(i, 3, stdstr(szValue).ToUTF16().c_str());
}
}

View File

@ -25,53 +25,53 @@ LRESULT CDebugTlb::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPara
{
DlgSavePos_Init(DebuggerUI_TLBPos);
LV_COLUMN col;
LV_COLUMN col;
float DPIScale = CClientDC(m_hWnd).GetDeviceCaps(LOGPIXELSX) / 96.0f;
col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
col.fmt = LVCFMT_LEFT;
col.pszText = "Index";
col.pszText = L"Index";
col.cx = (int)(40 * DPIScale);
col.iSubItem = 0;
ListView_InsertColumn(GetDlgItem(IDC_LIST), 0, &col);
col.pszText = "Page Mask";
col.pszText = L"Page Mask";
col.cx = (int)(90 * DPIScale);
col.iSubItem = 1;
ListView_InsertColumn(GetDlgItem(IDC_LIST), 1, &col);
col.pszText = "Entry Hi";
col.pszText = L"Entry Hi";
col.cx = (int)(90 * DPIScale);
col.iSubItem = 2;
ListView_InsertColumn(GetDlgItem(IDC_LIST), 2, &col);
col.pszText = "Entry Lo0";
col.pszText = L"Entry Lo0";
col.cx = (int)(90 * DPIScale);
col.iSubItem = 3;
ListView_InsertColumn(GetDlgItem(IDC_LIST), 3, &col);
col.pszText = "Entry Lo1";
col.pszText = L"Entry Lo1";
col.cx = (int)(90 * DPIScale);
col.iSubItem = 4;
ListView_InsertColumn(GetDlgItem(IDC_LIST), 4, &col);
col.pszText = "Index";
col.pszText = L"Index";
col.cx = (int)(40 * DPIScale);
col.iSubItem = 0;
ListView_InsertColumn(GetDlgItem(IDC_LIST2), 0, &col);
col.pszText = "Valid";
col.pszText = L"Valid";
col.cx = (int)(40 * DPIScale);
col.iSubItem = 1;
ListView_InsertColumn(GetDlgItem(IDC_LIST2), 1, &col);
col.pszText = "Dirty";
col.pszText = L"Dirty";
col.cx = (int)(40 * DPIScale);
col.iSubItem = 2;
ListView_InsertColumn(GetDlgItem(IDC_LIST2), 2, &col);
col.pszText = "Rule";
col.pszText = L"Rule";
col.cx = (int)(270 * DPIScale);
col.iSubItem = 3;
ListView_InsertColumn(GetDlgItem(IDC_LIST2), 3, &col);
@ -116,14 +116,14 @@ void CDebugTlb::RefreshTLBWindow(void)
}
HWND hList = GetDlgItem(IDC_LIST);
char Output[100], OldText[100];
wchar_t Output[100], OldText[100];
LV_ITEM item, OldItem;
int count;
CTLB::TLB_ENTRY * tlb = g_TLB->m_tlb;
for (count = 0; count < 32; count++)
{
sprintf(Output, "0x%02X", count);
swprintf(Output, sizeof(Output), L"0x%02X", count);
item.mask = LVIF_TEXT;
item.iItem = count;
item.pszText = Output;
@ -142,71 +142,71 @@ void CDebugTlb::RefreshTLBWindow(void)
else
{
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
}
if (tlb[count].EntryDefined)
{
sprintf(Output, "0x%08X", tlb[count].PageMask.Value);
swprintf(Output, sizeof(Output), L"0x%08X", tlb[count].PageMask.Value);
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 1;
OldItem.iSubItem = 1;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
if (tlb[count].EntryDefined)
{
sprintf(Output, "0x%08X", tlb[count].EntryHi.Value);
swprintf(Output, sizeof(Output), L"0x%08X", tlb[count].EntryHi.Value);
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 2;
OldItem.iSubItem = 2;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
if (tlb[count].EntryDefined)
{
sprintf(Output, "0x%08X", tlb[count].EntryLo0.Value);
swprintf(Output, sizeof(Output), L"0x%08X", tlb[count].EntryLo0.Value);
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 3;
OldItem.iSubItem = 3;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
if (tlb[count].EntryDefined)
{
sprintf(Output, "0x%08X", tlb[count].EntryLo1.Value);
swprintf(Output, sizeof(Output), L"0x%08X", tlb[count].EntryLo1.Value);
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 4;
OldItem.iSubItem = 4;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
@ -216,7 +216,7 @@ void CDebugTlb::RefreshTLBWindow(void)
hList = GetDlgItem(IDC_LIST2);
for (count = 0; count < 64; count++)
{
sprintf(Output, "0x%02X", count);
swprintf(Output, sizeof(Output), L"0x%02X", count);
item.mask = LVIF_TEXT;
item.iItem = count;
item.pszText = Output;
@ -235,7 +235,7 @@ void CDebugTlb::RefreshTLBWindow(void)
else
{
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
@ -243,49 +243,49 @@ void CDebugTlb::RefreshTLBWindow(void)
if (FastTlb[count].ValidEntry)
{
sprintf(Output, "%s", FastTlb[count].VALID ? "Yes" : "No");
swprintf(Output, sizeof(Output), L"%s", FastTlb[count].VALID ? L"Yes" : L"No");
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 1;
OldItem.iSubItem = 1;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
if (FastTlb[count].ValidEntry && FastTlb[count].VALID)
{
sprintf(Output, "%s", FastTlb[count].DIRTY ? "Yes" : "No");
swprintf(Output, sizeof(Output), L"%s", FastTlb[count].DIRTY ? L"Yes" : L"No");
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 2;
OldItem.iSubItem = 2;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}
if (FastTlb[count].ValidEntry && FastTlb[count].VALID)
{
sprintf(Output, "%08X:%08X -> %08X:%08X", FastTlb[count].VSTART, FastTlb[count].VEND,
swprintf(Output, sizeof(Output), L"%08X:%08X -> %08X:%08X", FastTlb[count].VSTART, FastTlb[count].VEND,
FastTlb[count].PHYSSTART, FastTlb[count].PHYSEND);
}
else
{
strcpy(Output, "................");
wcscpy(Output, L"................");
}
item.iSubItem = 3;
OldItem.iSubItem = 3;
ListView_GetItem(hList, &OldItem);
if (strcmp(item.pszText, OldItem.pszText) != 0)
if (wcscmp(item.pszText, OldItem.pszText) != 0)
{
ListView_SetItem(hList, &item);
}

View File

@ -283,7 +283,7 @@ void CDebugMemoryView::SetupJumpMenu(bool bVirtual)
break;
}
m_CmbJump.AddString(stdstr_f("%08X %s", bVirtual ? item->vaddr : item->paddr, item->caption).c_str());
m_CmbJump.AddString(stdstr_f("%08X %s", bVirtual ? item->vaddr : item->paddr, item->caption).ToUTF16().c_str());
}
m_CmbJump.SetRedraw(TRUE);
@ -689,7 +689,7 @@ LRESULT CDebugMemoryView::OnHxInsertModeChanged(LPNMHDR /*lpNMHDR*/)
{
m_SafeEditQueue.clear();
m_bSafeEditMode = m_HexEditCtrl.GetInsertMode();
m_StatusBar.SetText(MEMSB_SAFEMODE, m_bSafeEditMode ? "Safe mode" : "");
m_StatusBar.SetText(MEMSB_SAFEMODE, m_bSafeEditMode ? L"Safe mode" : L"");
return FALSE;
}
@ -704,19 +704,19 @@ LRESULT CDebugMemoryView::OnHxSelectionChanged(LPNMHDR /*lpNMHDR*/)
{
strBlock = stdstr_f("%08X:%08X", startAddress, endAddress);
strLength = stdstr_f("%X", endAddress - startAddress + 1);
m_StatusBar.SetText(MEMSB_BLOCK, strBlock.c_str());
m_StatusBar.SetText(MEMSB_BLOCKLEN, strLength.c_str());
m_StatusBar.SetText(MEMSB_BLOCK, strBlock.ToUTF16().c_str());
m_StatusBar.SetText(MEMSB_BLOCKLEN, strLength.ToUTF16().c_str());
}
else
{
strBlock = stdstr_f("%08X", startAddress);
m_StatusBar.SetText(MEMSB_BLOCK, strBlock.c_str());
m_StatusBar.SetText(MEMSB_BLOCKLEN, "");
m_StatusBar.SetText(MEMSB_BLOCK, strBlock.ToUTF16().c_str());
m_StatusBar.SetText(MEMSB_BLOCKLEN, L"");
}
uint32_t romAddr, offset;
DMALOGENTRY* entry = m_Debugger->DMALog()->GetEntryByRamAddress(startAddress, &romAddr, &offset);
m_StatusBar.SetText(MEMSB_DMAINFO, entry != NULL ? "Have DMA" : "");
m_StatusBar.SetText(MEMSB_DMAINFO, entry != NULL ? L"Have DMA" : L"");
return FALSE;
}
@ -942,7 +942,7 @@ LRESULT CDebugMemoryView::OnHxHotAddrChanged(LPNMHDR /*lpNMHDR*/)
strAddrInfo += stdstr_f("%08X\n", m_HotAddress);
}
m_StatusBar.SetText(MEMSB_HOTADDR, strAddrInfo.c_str());
m_StatusBar.SetText(MEMSB_HOTADDR, strAddrInfo.ToUTF16().c_str());
return FALSE;
}
@ -1053,10 +1053,10 @@ void CDebugMemoryView::TabSelChanged(void)
int CDebugMemoryView::AddTab(uint32_t address, bool bVirtual, int numBytesPerGroup)
{
char szAddress[12];
sprintf(szAddress, "%08X", address);
stdstr szAddress;
szAddress.Format("%08X", address);
m_TabData.push_back({ address, bVirtual, numBytesPerGroup });
return m_TabCtrl.AddItem(TCIF_TEXT | TCIF_PARAM, szAddress, 0, (LPARAM)address);
return m_TabCtrl.AddItem(TCIF_TEXT | TCIF_PARAM, szAddress.ToUTF16().c_str(), 0, (LPARAM)address);
}
int CDebugMemoryView::InsertTab(int nItem, uint32_t address, bool bVirtual, int numBytesPerGroup)
@ -1066,7 +1066,7 @@ int CDebugMemoryView::InsertTab(int nItem, uint32_t address, bool bVirtual, int
m_TabCtrl.DeleteAllItems();
for (size_t i = 0; i < m_TabData.size(); i++)
{
m_TabCtrl.AddItem(TCIF_TEXT, stdstr_f("%08X", m_TabData[i].address).c_str(), 0, 0);
m_TabCtrl.AddItem(TCIF_TEXT, stdstr_f("%08X", m_TabData[i].address).ToUTF16().c_str(), 0, 0);
}
m_TabCtrl.SetRedraw(TRUE);
return nItem + 1;
@ -1080,9 +1080,7 @@ void CDebugMemoryView::DeleteTab(int nItem)
void CDebugMemoryView::UpdateCurrentTab(uint32_t address)
{
char szAddress[12];
sprintf(szAddress, "%08X", address);
std::wstring szAddress = stdstr_f("%08X", address).ToUTF16();
int nItem = m_TabCtrl.GetCurSel();
if (nItem == -1)
@ -1092,7 +1090,7 @@ void CDebugMemoryView::UpdateCurrentTab(uint32_t address)
TCITEM item = { 0 };
item.mask = TCIF_TEXT;
item.pszText = szAddress;
item.pszText = (LPWSTR)szAddress.c_str();
m_TabCtrl.SetRedraw(FALSE);
m_TabCtrl.SetItem(nItem, &item);
@ -1207,7 +1205,7 @@ LRESULT CDebugMemoryView::OnStatusBarClick(LPNMHDR lpNMHDR)
stdstr strDmaTitle = stdstr_f("DMA Information for 0x%08X", startAddress);
stdstr strDmaInfo = stdstr_f("Block:\nROM 0x%08X -> RAM 0x%08X ( 0x%X bytes )\n\nROM address of byte:\n0x%08X ( 0x%08X + 0x%08X )",
entry->romAddr, entry->ramAddr, entry->length, romAddress, entry->romAddr, blockOffset);
MessageBox(strDmaInfo.c_str(), strDmaTitle.c_str(), MB_OK);
MessageBox(strDmaInfo.ToUTF16().c_str(), strDmaTitle.ToUTF16().c_str(), MB_OK);
}
else if (nmm->dwItemSpec == MEMSB_BLOCK)
{

View File

@ -681,7 +681,7 @@ void CDebuggerUI::FrameDrawn()
static HFONT monoFont = CreateFont(-11, 0, 0, 0,
FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
PROOF_QUALITY, FF_DONTCARE, "Consolas"
PROOF_QUALITY, FF_DONTCARE, L"Consolas"
);
if (hMainWnd == NULL)

View File

@ -160,7 +160,7 @@ CScanResult::~CScanResult(void)
{
}
void CScanResult::SetDescription(char* str)
void CScanResult::SetDescription(const char* str)
{
if (m_Description != NULL)
{
@ -313,7 +313,7 @@ uint32_t CScanResult::GetVirtualAddress(void)
}
}
bool CScanResult::SetMemoryValueFromString(char* str)
bool CScanResult::SetMemoryValueFromString(const char* str)
{
if (g_MMU == NULL)
{
@ -1015,7 +1015,7 @@ int CMemoryScanner::HexDigitVal(char c)
return 0;
}
int CMemoryScanner::ParseHexString(char *dst, char* src)
int CMemoryScanner::ParseHexString(char *dst, const char* src)
{
bool bHiNibble = true;
uint8_t curByte = 0;

View File

@ -154,10 +154,10 @@ public:
int GetMemoryValueString(char* buffer, size_t size, bool bIgnoreHex = false);
int GetAddressString(char *buffer);
uint32_t GetVirtualAddress(void);
bool SetMemoryValueFromString(char* str);
bool SetMemoryValueFromString(const char* str);
//bool IsSelected(void);
//void SetSelected(bool bSelected);
void SetDescription(char* str);
void SetDescription(const char* str);
const char* GetDescription(void);
void DeleteDescription(void);
bool GetMemoryValue(CMixed* v);
@ -176,7 +176,7 @@ public:
bool SetSearchType(SearchType searchType);
void SetAddressType(AddressType addressType);
static int ParseHexString(char* dst, char* src);
static int ParseHexString(char* dst, const char* src);
static bool AddrCheck(uint32_t addr, uint32_t rangeStart, uint32_t rangeEnd);
static bool RangeCheck(uint32_t addrStart, uint32_t addrEnd, uint32_t rangeStart, uint32_t rangeEnd);

View File

@ -58,7 +58,7 @@ CScriptInstance::CScriptInstance(CDebuggerUI* debugger)
m_NextListenerId = 0;
m_hIOCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
CacheInstance(this);
m_hKernel = LoadLibrary("Kernel32.dll");
m_hKernel = LoadLibraryA("Kernel32.dll");
m_CancelIoEx = NULL;
if (m_hKernel != NULL)
{
@ -152,7 +152,7 @@ void CScriptInstance::StartScriptProc()
if (apiresult != 0)
{
MessageBox(NULL, duk_safe_to_string(ctx, -1), "API Script Error", MB_OK | MB_ICONERROR);
MessageBox(NULL, stdstr(duk_safe_to_string(ctx, -1)).ToUTF16().c_str(), L"API Script Error", MB_OK | MB_ICONERROR);
return;
}
@ -463,7 +463,7 @@ void CScriptInstance::InvokeListenerCallback(IOLISTENER* lpListener)
if (status != DUK_EXEC_SUCCESS)
{
const char* msg = duk_safe_to_string(m_Ctx, -1);
MessageBox(NULL, msg, "Script error", MB_OK | MB_ICONWARNING);
MessageBox(NULL, stdstr(msg).ToUTF16().c_str(), L"Script error", MB_OK | MB_ICONWARNING);
}
}
@ -475,7 +475,7 @@ const char* CScriptInstance::Eval(const char* jsCode)
if (result != 0)
{
MessageBox(NULL, msg, "Script error", MB_OK | MB_ICONWARNING);
MessageBox(NULL, stdstr(msg).ToUTF16().c_str(), L"Script error", MB_OK | MB_ICONWARNING);
}
else
{
@ -553,7 +553,7 @@ const char* CScriptInstance::EvalFile(const char* jsPath)
const char* msg = duk_safe_to_string(m_Ctx, -1);
if (result != 0)
{
MessageBox(NULL, msg, jsPath, MB_OK | MB_ICONWARNING);
MessageBox(NULL, stdstr(msg).ToUTF16().c_str(), stdstr(jsPath).ToUTF16().c_str(), MB_OK | MB_ICONWARNING);
}
duk_pop(m_Ctx);
return msg;
@ -600,7 +600,7 @@ void CScriptInstance::QueueAPC(PAPCFUNC userProc, ULONG_PTR param)
{
if (m_hThread != NULL)
{
MessageBox(NULL, "apc queued", "", MB_OK);
MessageBox(NULL, L"apc queued", L"", MB_OK);
QueueUserAPC(userProc, m_hThread, param);
}
}
@ -733,7 +733,7 @@ duk_ret_t CScriptInstance::js_ioRead(duk_context* ctx)
if (status == false && GetLastError() != ERROR_IO_PENDING)
{
MessageBox(NULL, "readex error", "", MB_OK);
MessageBox(NULL, L"readex error", L"", MB_OK);
}
duk_pop_n(ctx, 3);
@ -1364,7 +1364,7 @@ duk_ret_t CScriptInstance::js_MsgBox(duk_context* ctx)
caption = duk_to_string(ctx, 1);
}
MessageBox(NULL, msg, caption, MB_OK);
MessageBox(NULL, stdstr(msg).ToUTF16().c_str(), stdstr(caption).ToUTF16().c_str(), MB_OK);
duk_pop_n(ctx, argc);
duk_push_boolean(ctx, 1);
@ -1553,7 +1553,7 @@ duk_ret_t CScriptInstance::js_ScreenPrint(duk_context* ctx)
int nChars = strlen(text);
TextOut(hdc, x, y, text, nChars);
TextOut(hdc, x, y, stdstr(text).ToUTF16().c_str(), nChars);
duk_pop_n(ctx, nargs);
return 1;
@ -1840,7 +1840,7 @@ duk_ret_t CScriptInstance::js_FSMkDir(duk_context* ctx)
duk_pop_n(ctx, nargs);
if (CreateDirectory(path, NULL))
if (CreateDirectoryA(path, NULL))
{
duk_push_true(ctx);
}
@ -1866,7 +1866,7 @@ duk_ret_t CScriptInstance::js_FSRmDir(duk_context* ctx)
duk_pop_n(ctx, nargs);
if (RemoveDirectory(path))
if (RemoveDirectoryA(path))
{
duk_push_true(ctx);
}
@ -1918,8 +1918,8 @@ duk_ret_t CScriptInstance::js_FSReadDir(duk_context* ctx)
duk_pop_n(ctx, nargs);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(stdstr_f("%s%s", path, "\\*").c_str(), &ffd);
WIN32_FIND_DATAA ffd;
HANDLE hFind = FindFirstFileA(stdstr_f("%s%s", path, "\\*").c_str(), &ffd);
if (hFind == INVALID_HANDLE_VALUE)
{
@ -1944,7 +1944,7 @@ duk_ret_t CScriptInstance::js_FSReadDir(duk_context* ctx)
duk_put_prop_index(ctx, arr_idx, nfile);
nfile++;
} while (FindNextFile(hFind, &ffd) != 0);
} while (FindNextFileA(hFind, &ffd) != 0);
FindClose(hFind);
return 1;

View File

@ -40,7 +40,7 @@ CScriptSystem::CScriptSystem(CDebuggerUI* debugger)
RegisterHook("draw", m_HookFrameDrawn);
HMODULE hInst = GetModuleHandle(NULL);
HRSRC hRes = FindResource(hInst, MAKEINTRESOURCE(IDR_JSAPI_TEXT), "TEXT");
HRSRC hRes = FindResource(hInst, MAKEINTRESOURCE(IDR_JSAPI_TEXT), L"TEXT");
HGLOBAL hGlob = LoadResource(hInst, hRes);
DWORD resSize = SizeofResource(hInst, hRes);
@ -109,7 +109,7 @@ void CScriptSystem::DeleteStoppedInstances()
}
}
INSTANCE_STATE CScriptSystem::GetInstanceState(char* path)
INSTANCE_STATE CScriptSystem::GetInstanceState(const char* path)
{
CGuard guard(m_CS);
@ -125,7 +125,7 @@ INSTANCE_STATE CScriptSystem::GetInstanceState(char* path)
return STATE_INVALID;
}
CScriptInstance* CScriptSystem::GetInstance(char* path)
CScriptInstance* CScriptSystem::GetInstance(const char* path)
{
CGuard guard(m_CS);

View File

@ -112,8 +112,8 @@ public:
}
void DeleteStoppedInstances();
INSTANCE_STATE GetInstanceState(char* scriptName);
CScriptInstance* GetInstance(char* scriptName);
INSTANCE_STATE GetInstanceState(const char* scriptName);
CScriptInstance* GetInstance(const char* scriptName);
CScriptHook* HookCPUExec()
{

View File

@ -138,7 +138,7 @@ void CSymbolTable::Load()
if (g_Settings->LoadStringVal(Game_GameName).length() == 0)
{
MessageBox(NULL, "Game must be loaded", "Symbols", MB_ICONWARNING | MB_OK);
MessageBox(NULL, L"Game must be loaded", L"Symbols", MB_ICONWARNING | MB_OK);
return;
}
@ -390,7 +390,7 @@ void CSymbolTable::GetValueString(char* dst, CSymbol* symbol)
void CSymbolTable::ParseErrorAlert(char* message, int lineNumber)
{
stdstr messageFormatted = stdstr_f("%s\nLine %d", message, lineNumber);
MessageBox(NULL, messageFormatted.c_str(), "Parse error", MB_OK | MB_ICONWARNING);
MessageBox(NULL, messageFormatted.ToUTF16().c_str(), L"Parse error", MB_OK | MB_ICONWARNING);
}
void CSymbolTable::Reset()
@ -404,7 +404,7 @@ bool CSymbolTable::CmpSymbolAddresses(CSymbol& a, CSymbol& b)
return (a.m_Address < b.m_Address);
}
void CSymbolTable::AddSymbol(int type, uint32_t address, char* name, char* description)
void CSymbolTable::AddSymbol(int type, uint32_t address, const char* name, const char* description)
{
CGuard guard(m_CS);

View File

@ -88,7 +88,7 @@ public:
void Save();
void ParseErrorAlert(char* message, int lineNumber);
void AddSymbol(int type, uint32_t address, char* name, char* description = NULL);
void AddSymbol(int type, uint32_t address, const char* name, const char* description = NULL);
void Reset();
int GetCount();
bool GetSymbolById(int id, CSymbol* symbol);
@ -115,7 +115,7 @@ public:
{
}
CSymbol(int id, int type, uint32_t address, char* name, char* description) :
CSymbol(int id, int type, uint32_t address, const char* name, const char* description) :
m_Id(id),
m_Type(type),
m_Address(address),

View File

@ -27,7 +27,7 @@ private:
CEditEnhancement(const CEditEnhancement&); // Disable copy constructor
CEditEnhancement& operator=(const CEditEnhancement&); // Disable assignment
std::string GetDlgItemStr(int nIDDlgItem);
std::wstring GetDlgItemStr(int nIDDlgItem);
int m_EditItem;
};
@ -244,12 +244,12 @@ LRESULT CEnhancementConfig::OnEnhancementListSelChanged(NMHDR * /*pNMHDR*/)
item.hItem = hItem;
m_TreeList.GetItem(&item);
std::string Notes(g_Settings->LoadStringIndex(Enhancement_Notes, item.lParam));
SetDlgItemText(IDC_NOTES, Notes.c_str());
stdstr Notes(g_Settings->LoadStringIndex(Enhancement_Notes, item.lParam));
SetDlgItemText(IDC_NOTES, Notes.ToUTF16().c_str());
}
else
{
SetDlgItemText(IDC_NOTES, "");
SetDlgItemText(IDC_NOTES, L"");
}
return TRUE;
}
@ -276,7 +276,7 @@ LRESULT CEnhancementConfig::OnDeleteItem(WORD /*wNotifyCode*/, WORD /*wID*/, HWN
{
return TRUE;
}
int Response = MessageBoxW(m_hWnd, wGS(MSG_DEL_SURE).c_str(), wGS(MSG_DEL_TITLE).c_str(), MB_YESNO | MB_ICONQUESTION);
int Response = MessageBox(wGS(MSG_DEL_SURE).c_str(), wGS(MSG_DEL_TITLE).c_str(), MB_YESNO | MB_ICONQUESTION);
if (Response != IDYES) { return TRUE; }
TVITEM item;
@ -389,10 +389,10 @@ void CEnhancementConfig::AddCodeLayers(int index, const std::string & Name, HTRE
TV_INSERTSTRUCT tv;
//Work out text to add
char Text[500], Item[500];
wchar_t Text[500], Item[500];
if (Name.length() > (sizeof(Text) - 5)) { g_Notify->BreakPoint(__FILE__, __LINE__); }
strcpy(Text, Name.c_str());
if (strchr(Text, '\\') > 0) { *strchr(Text, '\\') = 0; }
wcscpy(Text, stdstr(Name).ToUTF16().c_str());
if (wcschr(Text, L'\\') > 0) { *wcschr(Text, '\\') = 0; }
//See if text is already added
tv.item.mask = TVIF_TEXT;
@ -402,7 +402,7 @@ void CEnhancementConfig::AddCodeLayers(int index, const std::string & Name, HTRE
while (tv.item.hItem)
{
m_TreeList.GetItem(&tv.item);
if (strcmp(Text, Item) == 0)
if (wcscmp(Text, Item) == 0)
{
//If already exists then just use existing one
int State = TV_GetCheckState(tv.item.hItem);
@ -410,7 +410,7 @@ void CEnhancementConfig::AddCodeLayers(int index, const std::string & Name, HTRE
{
TV_SetCheckState(tv.item.hItem, TV_STATE_INDETERMINATE);
}
size_t StartPos = strlen(Text) + 1;
size_t StartPos = wcslen(Text) + 1;
stdstr TempCheatName;
if (StartPos < Name.length())
{
@ -431,8 +431,8 @@ void CEnhancementConfig::AddCodeLayers(int index, const std::string & Name, HTRE
hParent = m_TreeList.InsertItem(&tv);
TV_SetCheckState(hParent, Active ? TV_STATE_CHECKED : TV_STATE_CLEAR);
if (strcmp(Text, Name.c_str()) == 0) { return; }
AddCodeLayers(index, (stdstr)(Name.substr(strlen(Text) + 1)), hParent, Active);
if (wcscmp(Text, stdstr(Name).ToUTF16().c_str()) == 0) { return; }
AddCodeLayers(index, Name.substr(wcslen(Text) + 1), hParent, Active);
}
bool CEnhancementConfig::TV_SetCheckState( HTREEITEM hItem, TV_CHECK_STATE state)
@ -535,12 +535,12 @@ void CEditEnhancement::Display(HWND ParentWindow)
LRESULT CEditEnhancement::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
GetDlgItem(IDC_CODE_NAME).SetWindowTextA(m_EditItem >= 0 ? g_Settings->LoadStringIndex(Enhancement_Name, m_EditItem).c_str() : "");
GetDlgItem(IDC_NOTES).SetWindowTextA(m_EditItem >= 0 ? g_Settings->LoadStringIndex(Enhancement_Notes, m_EditItem).c_str() : "");
GetDlgItem(IDC_CODE_NAME).SetWindowText(stdstr(m_EditItem >= 0 ? g_Settings->LoadStringIndex(Enhancement_Name, m_EditItem) : "").ToUTF16().c_str());
GetDlgItem(IDC_NOTES).SetWindowText(stdstr(m_EditItem >= 0 ? g_Settings->LoadStringIndex(Enhancement_Notes, m_EditItem).c_str() : "").ToUTF16().c_str());
CButton(GetDlgItem(IDC_AUTOON)).SetCheck(g_Settings->LoadBoolIndex(Enhancement_OnByDefault, m_EditItem) ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_OVERCLOCK)).SetCheck(g_Settings->LoadBoolIndex(Enhancement_Overclock, m_EditItem) ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_GAMESHARK)).SetCheck(g_Settings->LoadBoolIndex(Enhancement_Gameshark, m_EditItem) ? BST_CHECKED : BST_UNCHECKED);
GetDlgItem(IDC_OVER_CLOCK_MODIFIER).SetWindowTextA(m_EditItem >= 0 ? stdstr_f("%d", g_Settings->LoadDwordIndex(Enhancement_OverclockValue, m_EditItem)).c_str() : "");
GetDlgItem(IDC_OVER_CLOCK_MODIFIER).SetWindowText(stdstr(m_EditItem >= 0 ? stdstr_f("%d", g_Settings->LoadDwordIndex(Enhancement_OverclockValue, m_EditItem)).c_str() : "").ToUTF16().c_str());
return TRUE;
}
@ -558,7 +558,7 @@ LRESULT CEditEnhancement::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWnd
LRESULT CEditEnhancement::OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
std::string NewName = GetDlgItemStr(IDC_CODE_NAME);
std::string NewName = stdstr().FromUTF16(GetDlgItemStr(IDC_CODE_NAME).c_str());
for (int i = 0; i < CCheats::MaxCheats; i++)
{
@ -588,29 +588,29 @@ LRESULT CEditEnhancement::OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl
return true;
}
g_Settings->SaveStringIndex(Enhancement_Name, m_EditItem, NewName);
g_Settings->SaveStringIndex(Enhancement_Notes, m_EditItem, GetDlgItemStr(IDC_NOTES));
g_Settings->SaveStringIndex(Enhancement_Notes, m_EditItem, stdstr().FromUTF16(GetDlgItemStr(IDC_NOTES).c_str()).c_str());
g_Settings->SaveBoolIndex(Enhancement_OnByDefault, m_EditItem, CButton(GetDlgItem(IDC_AUTOON)).GetCheck() == 1);
g_Settings->SaveBoolIndex(Enhancement_Overclock, m_EditItem, CButton(GetDlgItem(IDC_OVERCLOCK)).GetCheck() == 1);
g_Settings->SaveDwordIndex(Enhancement_OverclockValue, m_EditItem, atoi(GetDlgItemStr(IDC_OVER_CLOCK_MODIFIER).c_str()));
g_Settings->SaveDwordIndex(Enhancement_OverclockValue, m_EditItem, _wtoi(GetDlgItemStr(IDC_OVER_CLOCK_MODIFIER).c_str()));
g_Settings->SaveBoolIndex(Enhancement_Gameshark, m_EditItem, CButton(GetDlgItem(IDC_GAMESHARK)).GetCheck() == 1);
CSettingTypeEnhancements::FlushChanges();
EndDialog(wID);
return TRUE;
}
std::string CEditEnhancement::GetDlgItemStr(int nIDDlgItem)
std::wstring CEditEnhancement::GetDlgItemStr(int nIDDlgItem)
{
CWindow DlgItem = GetDlgItem(nIDDlgItem);
int length = DlgItem.SendMessage(WM_GETTEXTLENGTH, 0, 0);
if (length == 0)
{
return "";
return L"";
}
stdstr Result;
std::wstring Result;
Result.resize(length + 1);
DlgItem.GetWindowText((char *)Result.c_str(), Result.length());
DlgItem.GetWindowText((wchar_t *)Result.c_str(), Result.length());
return Result;
}
@ -682,7 +682,7 @@ LRESULT CEditGS::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*
}
} while (ReadPos);
CWindow Code = GetDlgItem(IDC_CHEAT_CODES);
Code.SetWindowText(Buffer.c_str());
Code.SetWindowText(stdstr(Buffer.c_str()).ToUTF16().c_str());
Code.SetFocus();
Code.PostMessage(EM_SETSEL, (WPARAM)-1, 0);
return TRUE;

View File

@ -28,7 +28,7 @@ void EnterLogOptions(HWND hwndOwner)
psp[0].hInstance = GetModuleHandle(NULL);
psp[0].pszTemplate = MAKEINTRESOURCE(IDD_Logging_Registers);
psp[0].pfnDlgProc = (DLGPROC)LogRegProc;
psp[0].pszTitle = "Registers";
psp[0].pszTitle = L"Registers";
psp[0].lParam = (LPARAM)&logSettings;
psp[0].pfnCallback = NULL;
@ -37,7 +37,7 @@ void EnterLogOptions(HWND hwndOwner)
psp[1].hInstance = GetModuleHandle(NULL);
psp[1].pszTemplate = MAKEINTRESOURCE(IDD_Logging_PifRam);
psp[1].pfnDlgProc = (DLGPROC)LogPifProc;
psp[1].pszTitle = "Pif Ram";
psp[1].pszTitle = L"Pif Ram";
psp[1].lParam = (LPARAM)&logSettings;
psp[1].pfnCallback = NULL;
@ -46,7 +46,7 @@ void EnterLogOptions(HWND hwndOwner)
psp[2].hInstance = GetModuleHandle(NULL);
psp[2].pszTemplate = MAKEINTRESOURCE(IDD_Logging_General);
psp[2].pfnDlgProc = (DLGPROC)LogGeneralProc;
psp[2].pszTitle = "General";
psp[2].pszTitle = L"General";
psp[2].lParam = (LPARAM)&logSettings;
psp[2].pfnCallback = NULL;
@ -54,7 +54,7 @@ void EnterLogOptions(HWND hwndOwner)
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW;
psh.hwndParent = hwndOwner;
psh.hInstance = GetModuleHandle(NULL);
psh.pszCaption = (LPSTR) "Log Options";
psh.pszCaption = (LPTSTR)L"Log Options";
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.nStartPage = 0;
psh.ppsp = (LPCPROPSHEETPAGE)&psp;

View File

@ -212,7 +212,7 @@ void CMainMenu::OnSaveAs(HWND hWnd)
{
char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
char Directory[255], SaveFile[255];
OPENFILENAME openfilename;
OPENFILENAMEA openfilename;
memset(&SaveFile, 0, sizeof(SaveFile));
memset(&openfilename, 0, sizeof(openfilename));
@ -228,7 +228,7 @@ void CMainMenu::OnSaveAs(HWND hWnd)
openfilename.Flags = OFN_HIDEREADONLY;
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_SaveGame);
if (GetSaveFileName(&openfilename))
if (GetSaveFileNameA(&openfilename))
{
_splitpath(SaveFile, drive, dir, fname, ext);
if (_stricmp(ext, ".pj") == 0 || _stricmp(ext, ".zip") == 0)
@ -418,7 +418,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
WriteTrace(TraceError, TraceDebug, "Exception when going to full screen");
char Message[600];
sprintf(Message, "Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__);
MessageBox(NULL, Message, "Exception", MB_OK);
MessageBox(NULL, stdstr(Message).ToUTF16().c_str(), L"Exception", MB_OK);
}
WriteTrace(TraceUserInterface, TraceDebug, "ID_OPTIONS_FULLSCREEN b 4");
m_Gui->MakeWindowOnTop(false);
@ -572,8 +572,8 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
g_Notify->DisplayMessage(3, stdstr_f(GS(MENU_SLOT_SAVE), GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1).c_str()).c_str());
g_Settings->SaveDword(Game_CurrentSaveState, (DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1));
break;
case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break;
case ID_HELP_HOMEPAGE: ShellExecute(NULL, "open", "http://www.pj64-emu.com", NULL, NULL, SW_SHOWMAXIMIZED); break;
case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, L"open", L"http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break;
case ID_HELP_HOMEPAGE: ShellExecute(NULL, L"open", L"http://www.pj64-emu.com", NULL, NULL, SW_SHOWMAXIMIZED); break;
case ID_HELP_ABOUT: m_Gui->AboutBox(); break;
case ID_HELP_ABOUTSETTINGFILES: m_Gui->AboutIniBox(); break;
default:
@ -627,7 +627,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
stdstr CMainMenu::GetFileLastMod(const CPath & FileName)
{
HANDLE hFile = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, NULL,
HANDLE hFile = CreateFileA(FileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{

View File

@ -100,7 +100,7 @@ CMainGui::~CMainGui(void)
bool CMainGui::RegisterWinClass(void)
{
stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR);
std::wstring VersionDisplay = stdstr_f("Project64 %s", VER_FILE_VERSION_STR).ToUTF16();
WNDCLASS wcl;
@ -499,7 +499,7 @@ void CMainGui::Create(const char * WindowTitle)
void CMainGui::CreateStatusBar(void)
{
m_hStatusWnd = (HWND)CreateStatusWindow(WS_CHILD | WS_VISIBLE, "", m_hMainWindow, StatusBarID);
m_hStatusWnd = (HWND)CreateStatusWindow(WS_CHILD | WS_VISIBLE, L"", m_hMainWindow, StatusBarID);
SendMessage((HWND)m_hStatusWnd, SB_SETTEXT, 0, (LPARAM)"");
}
@ -700,7 +700,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
//record class for future usage
LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
CMainGui * _this = (CMainGui *)lpcs->lpCreateParams;
SetProp(hWnd, "Class", _this);
SetProp(hWnd, L"Class", _this);
_this->m_hMainWindow = hWnd;
_this->CreateStatusBar();
@ -722,7 +722,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
case SC_SCREENSAVE:
case SC_MONITORPOWER:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this &&
_this->bCPURunning() &&
!g_Settings->LoadBool(GameRunning_CPU_Paused) &&
@ -734,7 +734,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case SC_MAXIMIZE:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this)
{
if (_this->RomBrowserVisible())
@ -749,7 +749,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_MOVE:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (!_this->m_bMainWindow ||
!_this->m_Created ||
@ -804,14 +804,14 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
if (wParam == Timer_SetWindowPos)
{
KillTimer(hWnd, Timer_SetWindowPos);
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
_this->SaveWindowLoc();
break;
}
break;
case WM_SIZE:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this) { _this->Resize(wParam, LOWORD(lParam), HIWORD(lParam)); }
if (_this)
{
@ -835,7 +835,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_NOTIFY:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this == NULL || !_this->RomBrowserVisible() || !_this->RomListNotify(wParam, lParam))
{
return DefWindowProc(hWnd, uMsg, wParam, lParam);
@ -844,7 +844,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_DRAWITEM:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this)
{
if (!_this->RomListDrawItem(wParam, lParam))
@ -870,7 +870,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_KEYUP:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this->m_bMainWindow && bCPURunning())
{
@ -885,7 +885,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_KEYDOWN:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this->m_bMainWindow && bCPURunning())
{
@ -901,7 +901,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_SETFOCUS:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this->RomBrowserVisible())
{
PostMessage(hWnd, WM_BROWSER_TOP, 0, 0);
@ -919,7 +919,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_KILLFOCUS:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this->RomBrowserVisible())
{
break;
@ -936,7 +936,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_ACTIVATEAPP:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
DWORD fActive = (BOOL)wParam;
if (fActive && _this->RomBrowserVisible())
@ -976,19 +976,19 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_MAKE_FOCUS:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
_this->BringToTop();
}
break;
case WM_BROWSER_TOP:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
_this->RomBrowserToTop();
}
break;
case WM_RESET_PLUGIN:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this->m_ResetInfo != NULL)
{
g_Notify->BreakPoint(__FILE__, __LINE__);
@ -999,7 +999,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_GAME_CLOSED:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
Notify().WindowMode();
if (UISettingsLoadBool(RomBrowser_Enabled))
{
@ -1013,7 +1013,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
break;
case WM_COMMAND:
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this == NULL) { break; }
switch (LOWORD(wParam)) {
@ -1180,7 +1180,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
char filename[MAX_PATH];
HDROP hDrop = (HDROP)wParam;
DragQueryFile(hDrop, 0, filename, sizeof(filename));
DragQueryFileA(hDrop, 0, filename, sizeof(filename));
DragFinish(hDrop);
stdstr ext = CPath(filename).GetExtension();
@ -1197,7 +1197,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
case WM_DESTROY:
WriteTrace(TraceUserInterface, TraceDebug, "WM_DESTROY - start");
{
CMainGui * _this = (CMainGui *)GetProp(hWnd, "Class");
CMainGui * _this = (CMainGui *)GetProp(hWnd, L"Class");
if (_this->m_bMainWindow)
{
Notify().WindowMode();
@ -1212,7 +1212,7 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
}
}
WriteTrace(TraceUserInterface, TraceDebug, "WM_DESTROY - 3");
RemoveProp(hWnd, "Class");
RemoveProp(hWnd, L"Class");
WriteTrace(TraceUserInterface, TraceDebug, "WM_DESTROY - 4");
PostQuitMessage(0);
WriteTrace(TraceUserInterface, TraceDebug, "WM_DESTROY - Done");
@ -1245,10 +1245,10 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD /*lParam*
BITMAP bmTL;
GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL);
hTextFont = ::CreateFont((int)(18 * DPIScale), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial");
hAuthorFont = ::CreateFont((int)(18 * DPIScale), 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial");
hTextFont = ::CreateFont((int)(18 * DPIScale), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial");
hAuthorFont = ::CreateFont((int)(18 * DPIScale), 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial");
hPageHeadingFont = ::CreateFont((int)(24 * DPIScale), 0, 0, 0, FW_BOLD, 0, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial Bold");
hPageHeadingFont = ::CreateFont((int)(24 * DPIScale), 0, 0, 0, FW_BOLD, 0, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial Bold");
SendDlgItemMessage(hWnd, IDC_VERSION, WM_SETFONT, (WPARAM)hTextFont, TRUE);
SendDlgItemMessage(hWnd, IDC_TEAM, WM_SETFONT, (WPARAM)hPageHeadingFont, TRUE);
@ -1267,7 +1267,7 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD /*lParam*
SendDlgItemMessage(hWnd, IDC_THANK_LIST, WM_SETFONT, (WPARAM)hTextFont, TRUE);
stdstr_f VersionDisplay("Version: %s", VER_FILE_VERSION_STR);
SetWindowText(GetDlgItem(hWnd, IDC_VERSION), VersionDisplay.c_str());
SetWindowText(GetDlgItem(hWnd, IDC_VERSION), VersionDisplay.ToUTF16().c_str());
}
break;
case WM_CTLCOLORSTATIC:

View File

@ -1,170 +1,170 @@
#include "stdafx.h"
VIRTUAL_KEY CMenuShortCutKey::m_VirtualKeyList[] = {
{ "VK_LBUTTON", 0x01, "VK_LBUTTON" },
{ "VK_RBUTTON", 0x02, "VK_RBUTTON" },
{ "VK_CANCEL", 0x03, "VK_CANCEL" },
{ "VK_MBUTTON", 0x04, "VK_MBUTTON" },
{ "VK_XBUTTON1", 0x05, "VK_XBUTTON1" },
{ "VK_XBUTTON2", 0x06, "VK_XBUTTON2" },
{ "VK_BACK", 0x08, "VK_BACK" },
{ "VK_TAB", 0x09, "VK_TAB" },
{ "VK_CLEAR", 0x0C, "VK_CLEAR" },
{ "VK_RETURN", 0x0D, "Return" },
{ "VK_SHIFT", 0x10, "VK_SHIFT" },
{ "VK_CONTROL", 0x11, "VK_CONTROL" },
{ "VK_MENU", 0x12, "VK_MENU" },
{ "VK_PAUSE", 0x13, "Pause" },
{ "VK_CAPITAL", 0x14, "VK_CAPITAL" },
{ "VK_KANA", 0x15, "VK_KANA" },
{ "VK_HANGUL", 0x15, "VK_HANGUL" },
{ "VK_JUNJA", 0x17, "VK_JUNJA" },
{ "VK_FINAL", 0x18, "VK_FINAL" },
{ "VK_HANJA", 0x19, "VK_HANJA" },
{ "VK_KANJI", 0x19, "VK_KANJI" },
{ "VK_ESCAPE", 0x1B, "Esc" },
{ "VK_CONVERT", 0x1C, "VK_CONVERT" },
{ "VK_NONCONVERT", 0x1D, "VK_NONCONVERT" },
{ "VK_ACCEPT", 0x1E, "VK_ACCEPT" },
{ "VK_MODECHANGE", 0x1F, "VK_MODECHANGE" },
{ "VK_SPACE", 0x20, "Space" },
{ "VK_PRIOR", 0x21, "Page Up" },
{ "VK_NEXT", 0x22, "Page Down" },
{ "VK_END", 0x23, "End" },
{ "VK_HOME", 0x24, "Home" },
{ "VK_LEFT", 0x25, "Left" },
{ "VK_UP", 0x26, "Up" },
{ "VK_RIGHT", 0x27, "Right" },
{ "VK_DOWN", 0x28, "Down" },
{ "VK_SELECT", 0x29, "VK_SELECT" },
{ "VK_PRINT", 0x2A, "VK_PRINT" },
{ "VK_EXECUTE", 0x2B, "VK_EXECUTE" },
{ "VK_SNAPSHOT", 0x2C, "VK_SNAPSHOT" },
{ "VK_INSERT", 0x2D, "Insert" },
{ "VK_DELETE", 0x2E, "Delete" },
{ "VK_HELP", 0x2F, "Help" },
{ "VK_0", 0x30, "0" },
{ "VK_1", 0x31, "1" },
{ "VK_2", 0x32, "2" },
{ "VK_3", 0x33, "3" },
{ "VK_4", 0x34, "4" },
{ "VK_5", 0x35, "5" },
{ "VK_6", 0x36, "6" },
{ "VK_7", 0x37, "7" },
{ "VK_8", 0x38, "8" },
{ "VK_9", 0x39, "9" },
{ "VK_A", 0x41, "A" },
{ "VK_B", 0x42, "B" },
{ "VK_C", 0x43, "C" },
{ "VK_D", 0x44, "D" },
{ "VK_E", 0x45, "E" },
{ "VK_F", 0x46, "F" },
{ "VK_G", 0x47, "G" },
{ "VK_H", 0x48, "H" },
{ "VK_I", 0x49, "I" },
{ "VK_J", 0x4A, "J" },
{ "VK_K", 0x4B, "K" },
{ "VK_L", 0x4C, "L" },
{ "VK_M", 0x4D, "M" },
{ "VK_N", 0x4E, "N" },
{ "VK_O", 0x4F, "O" },
{ "VK_P", 0x50, "P" },
{ "VK_Q", 0x51, "Q" },
{ "VK_R", 0x52, "R" },
{ "VK_S", 0x53, "S" },
{ "VK_T", 0x54, "T" },
{ "VK_U", 0x55, "U" },
{ "VK_V", 0x56, "V" },
{ "VK_W", 0x57, "W" },
{ "VK_X", 0x58, "X" },
{ "VK_Y", 0x59, "Y" },
{ "VK_Z", 0x5A, "Z" },
{ "VK_LWIN", 0x5B, "VK_LWIN" },
{ "VK_RWIN", 0x5C, "VK_RWIN" },
{ "VK_APPS", 0x5D, "VK_APPS" },
{ "VK_SLEEP", 0x5D, "VK_SLEEP" },
{ "VK_NUMPAD0", 0x60, "Numpad0" },
{ "VK_NUMPAD1", 0x61, "Numpad1" },
{ "VK_NUMPAD2", 0x62, "Numpad2" },
{ "VK_NUMPAD3", 0x63, "Numpad3" },
{ "VK_NUMPAD4", 0x64, "Numpad4" },
{ "VK_NUMPAD5", 0x65, "Numpad5" },
{ "VK_NUMPAD6", 0x66, "Numpad6" },
{ "VK_NUMPAD7", 0x67, "Numpad7" },
{ "VK_NUMPAD8", 0x68, "Numpad8" },
{ "VK_NUMPAD9", 0x69, "Numpad9" },
{ "VK_MULTIPLY", 0x6A, "*" },
{ "VK_ADD", 0x6B, "+" },
{ "VK_SEPARATOR", 0x6C, "" },
{ "VK_SUBTRACT", 0x6D, "-" },
{ "VK_DECIMAL", 0x6E, "." },
{ "VK_DIVIDE", 0x6F, "/" },
{ "VK_F1", 0x70, "F1" },
{ "VK_F2", 0x71, "F2" },
{ "VK_F3", 0x72, "F3" },
{ "VK_F4", 0x73, "F4" },
{ "VK_F5", 0x74, "F5" },
{ "VK_F6", 0x75, "F6" },
{ "VK_F7", 0x76, "F7" },
{ "VK_F8", 0x77, "F8" },
{ "VK_F9", 0x78, "F9" },
{ "VK_F10", 0x79, "F10" },
{ "VK_F11", 0x7A, "F11" },
{ "VK_F12", 0x7B, "F12" },
{ "VK_F13", 0x7C, "F13" },
{ "VK_F14", 0x7D, "F14" },
{ "VK_F15", 0x7E, "F15" },
{ "VK_F16", 0x7F, "F16" },
{ "VK_F17", 0x80, "F17" },
{ "VK_F18", 0x81, "F18" },
{ "VK_F19", 0x82, "F19" },
{ "VK_F20", 0x83, "F20" },
{ "VK_F21", 0x84, "F21" },
{ "VK_F22", 0x85, "F22" },
{ "VK_F23", 0x86, "F23" },
{ "VK_F24", 0x87, "F24" },
{ "VK_NUMLOCK", 0x90, "Numlock" },
{ "VK_SCROLL", 0x91, "VK_SCROLL" },
{ "VK_LSHIFT", 0xA0, "VK_LSHIFT" },
{ "VK_RSHIFT", 0xA1, "VK_RSHIFT" },
{ "VK_LCONTROL", 0xA2, "VK_LCONTROL" },
{ "VK_RCONTROL", 0xA3, "VK_RCONTROL" },
{ "VK_LMENU", 0xA4, "VK_LMENU" },
{ "VK_RMENU", 0xA5, "VK_RMENU" },
{ "VK_BROWSER_BACK", 0xA6, "" },
{ "VK_BROWSER_FORWARD", 0xA7, "" },
{ "VK_BROWSER_REFRESH", 0xA8, "" },
{ "VK_BROWSER_STOP", 0xA9, "" },
{ "VK_BROWSER_SEARCH", 0xAA, "" },
{ "VK_BROWSER_FAVORITES", 0xAB, "" },
{ "VK_BROWSER_HOME", 0xAC, "" },
{ "VK_VOLUME_MUTE", 0xAD, "" },
{ "VK_VOLUME_DOWN", 0xAE, "" },
{ "VK_VOLUME_UP", 0xAF, "" },
{ "VK_MEDIA_NEXT_TRACK", 0xB0, "" },
{ "VK_MEDIA_PREV_TRACK", 0xB1, "" },
{ "VK_MEDIA_STOP", 0xB2, "" },
{ "VK_MEDIA_PLAY_PAUSE", 0xB3, "" },
{ "VK_LAUNCH_MAIL", 0xB4, "" },
{ "VK_LAUNCH_MEDIA_SELECT", 0xB5, "" },
{ "VK_LAUNCH_APP1", 0xB6, "" },
{ "VK_LAUNCH_APP2", 0xB7, "" },
{ "VK_OEM_1 (;:)", 0xBA, "" },
{ "VK_OEM_PLUS", 0xBB, "+" },
{ "VK_OEM_COMMA", 0xBC, "" },
{ "VK_OEM_MINUS", 0xBD, "-" },
{ "VK_OEM_PERIOD", 0xBE, "." },
{ "VK_OEM_2 (/?)", 0xBF, "" },
{ "VK_OEM_3 (`~)", 0xC0, "~" },
{ "VK_ATTN", 0xF6, "" },
{ "VK_CRSEL", 0xF7, "" },
{ "VK_EXSEL", 0xF8, "" },
{ "VK_EREOF", 0xF9, "" },
{ "VK_PLAY", 0xFA, "" },
{ "VK_ZOOM", 0xFB, "" },
{ "VK_NONAME", 0xFC, "" },
{ "VK_PA1", 0xFD, "" },
{ "VK_OEM_CLEAR", 0xFE }
{ L"VK_LBUTTON", 0x01, L"VK_LBUTTON" },
{ L"VK_RBUTTON", 0x02, L"VK_RBUTTON" },
{ L"VK_CANCEL", 0x03, L"VK_CANCEL" },
{ L"VK_MBUTTON", 0x04, L"VK_MBUTTON" },
{ L"VK_XBUTTON1", 0x05, L"VK_XBUTTON1" },
{ L"VK_XBUTTON2", 0x06, L"VK_XBUTTON2" },
{ L"VK_BACK", 0x08, L"VK_BACK" },
{ L"VK_TAB", 0x09, L"VK_TAB" },
{ L"VK_CLEAR", 0x0C, L"VK_CLEAR" },
{ L"VK_RETURN", 0x0D, L"Return" },
{ L"VK_SHIFT", 0x10, L"VK_SHIFT" },
{ L"VK_CONTROL", 0x11, L"VK_CONTROL" },
{ L"VK_MENU", 0x12, L"VK_MENU" },
{ L"VK_PAUSE", 0x13, L"Pause" },
{ L"VK_CAPITAL", 0x14, L"VK_CAPITAL" },
{ L"VK_KANA", 0x15, L"VK_KANA" },
{ L"VK_HANGUL", 0x15, L"VK_HANGUL" },
{ L"VK_JUNJA", 0x17, L"VK_JUNJA" },
{ L"VK_FINAL", 0x18, L"VK_FINAL" },
{ L"VK_HANJA", 0x19, L"VK_HANJA" },
{ L"VK_KANJI", 0x19, L"VK_KANJI" },
{ L"VK_ESCAPE", 0x1B, L"Esc" },
{ L"VK_CONVERT", 0x1C, L"VK_CONVERT" },
{ L"VK_NONCONVERT", 0x1D, L"VK_NONCONVERT" },
{ L"VK_ACCEPT", 0x1E, L"VK_ACCEPT" },
{ L"VK_MODECHANGE", 0x1F, L"VK_MODECHANGE" },
{ L"VK_SPACE", 0x20, L"Space" },
{ L"VK_PRIOR", 0x21, L"Page Up" },
{ L"VK_NEXT", 0x22, L"Page Down" },
{ L"VK_END", 0x23, L"End" },
{ L"VK_HOME", 0x24, L"Home" },
{ L"VK_LEFT", 0x25, L"Left" },
{ L"VK_UP", 0x26, L"Up" },
{ L"VK_RIGHT", 0x27, L"Right" },
{ L"VK_DOWN", 0x28, L"Down" },
{ L"VK_SELECT", 0x29, L"VK_SELECT" },
{ L"VK_PRINT", 0x2A, L"VK_PRINT" },
{ L"VK_EXECUTE", 0x2B, L"VK_EXECUTE" },
{ L"VK_SNAPSHOT", 0x2C, L"VK_SNAPSHOT" },
{ L"VK_INSERT", 0x2D, L"Insert" },
{ L"VK_DELETE", 0x2E, L"Delete" },
{ L"VK_HELP", 0x2F, L"Help" },
{ L"VK_0", 0x30, L"0" },
{ L"VK_1", 0x31, L"1" },
{ L"VK_2", 0x32, L"2" },
{ L"VK_3", 0x33, L"3" },
{ L"VK_4", 0x34, L"4" },
{ L"VK_5", 0x35, L"5" },
{ L"VK_6", 0x36, L"6" },
{ L"VK_7", 0x37, L"7" },
{ L"VK_8", 0x38, L"8" },
{ L"VK_9", 0x39, L"9" },
{ L"VK_A", 0x41, L"A" },
{ L"VK_B", 0x42, L"B" },
{ L"VK_C", 0x43, L"C" },
{ L"VK_D", 0x44, L"D" },
{ L"VK_E", 0x45, L"E" },
{ L"VK_F", 0x46, L"F" },
{ L"VK_G", 0x47, L"G" },
{ L"VK_H", 0x48, L"H" },
{ L"VK_I", 0x49, L"I" },
{ L"VK_J", 0x4A, L"J" },
{ L"VK_K", 0x4B, L"K" },
{ L"VK_L", 0x4C, L"L" },
{ L"VK_M", 0x4D, L"M" },
{ L"VK_N", 0x4E, L"N" },
{ L"VK_O", 0x4F, L"O" },
{ L"VK_P", 0x50, L"P" },
{ L"VK_Q", 0x51, L"Q" },
{ L"VK_R", 0x52, L"R" },
{ L"VK_S", 0x53, L"S" },
{ L"VK_T", 0x54, L"T" },
{ L"VK_U", 0x55, L"U" },
{ L"VK_V", 0x56, L"V" },
{ L"VK_W", 0x57, L"W" },
{ L"VK_X", 0x58, L"X" },
{ L"VK_Y", 0x59, L"Y" },
{ L"VK_Z", 0x5A, L"Z" },
{ L"VK_LWIN", 0x5B, L"VK_LWIN" },
{ L"VK_RWIN", 0x5C, L"VK_RWIN" },
{ L"VK_APPS", 0x5D, L"VK_APPS" },
{ L"VK_SLEEP", 0x5D, L"VK_SLEEP" },
{ L"VK_NUMPAD0", 0x60, L"Numpad0" },
{ L"VK_NUMPAD1", 0x61, L"Numpad1" },
{ L"VK_NUMPAD2", 0x62, L"Numpad2" },
{ L"VK_NUMPAD3", 0x63, L"Numpad3" },
{ L"VK_NUMPAD4", 0x64, L"Numpad4" },
{ L"VK_NUMPAD5", 0x65, L"Numpad5" },
{ L"VK_NUMPAD6", 0x66, L"Numpad6" },
{ L"VK_NUMPAD7", 0x67, L"Numpad7" },
{ L"VK_NUMPAD8", 0x68, L"Numpad8" },
{ L"VK_NUMPAD9", 0x69, L"Numpad9" },
{ L"VK_MULTIPLY", 0x6A, L"*" },
{ L"VK_ADD", 0x6B, L"+" },
{ L"VK_SEPARATOR", 0x6C, L"" },
{ L"VK_SUBTRACT", 0x6D, L"-" },
{ L"VK_DECIMAL", 0x6E, L"." },
{ L"VK_DIVIDE", 0x6F, L"/" },
{ L"VK_F1", 0x70, L"F1" },
{ L"VK_F2", 0x71, L"F2" },
{ L"VK_F3", 0x72, L"F3" },
{ L"VK_F4", 0x73, L"F4" },
{ L"VK_F5", 0x74, L"F5" },
{ L"VK_F6", 0x75, L"F6" },
{ L"VK_F7", 0x76, L"F7" },
{ L"VK_F8", 0x77, L"F8" },
{ L"VK_F9", 0x78, L"F9" },
{ L"VK_F10", 0x79, L"F10" },
{ L"VK_F11", 0x7A, L"F11" },
{ L"VK_F12", 0x7B, L"F12" },
{ L"VK_F13", 0x7C, L"F13" },
{ L"VK_F14", 0x7D, L"F14" },
{ L"VK_F15", 0x7E, L"F15" },
{ L"VK_F16", 0x7F, L"F16" },
{ L"VK_F17", 0x80, L"F17" },
{ L"VK_F18", 0x81, L"F18" },
{ L"VK_F19", 0x82, L"F19" },
{ L"VK_F20", 0x83, L"F20" },
{ L"VK_F21", 0x84, L"F21" },
{ L"VK_F22", 0x85, L"F22" },
{ L"VK_F23", 0x86, L"F23" },
{ L"VK_F24", 0x87, L"F24" },
{ L"VK_NUMLOCK", 0x90, L"Numlock" },
{ L"VK_SCROLL", 0x91, L"VK_SCROLL" },
{ L"VK_LSHIFT", 0xA0, L"VK_LSHIFT" },
{ L"VK_RSHIFT", 0xA1, L"VK_RSHIFT" },
{ L"VK_LCONTROL", 0xA2, L"VK_LCONTROL" },
{ L"VK_RCONTROL", 0xA3, L"VK_RCONTROL" },
{ L"VK_LMENU", 0xA4, L"VK_LMENU" },
{ L"VK_RMENU", 0xA5, L"VK_RMENU" },
{ L"VK_BROWSER_BACK", 0xA6, L"" },
{ L"VK_BROWSER_FORWARD", 0xA7, L"" },
{ L"VK_BROWSER_REFRESH", 0xA8, L"" },
{ L"VK_BROWSER_STOP", 0xA9, L"" },
{ L"VK_BROWSER_SEARCH", 0xAA, L"" },
{ L"VK_BROWSER_FAVORITES", 0xAB, L"" },
{ L"VK_BROWSER_HOME", 0xAC, L"" },
{ L"VK_VOLUME_MUTE", 0xAD, L"" },
{ L"VK_VOLUME_DOWN", 0xAE, L"" },
{ L"VK_VOLUME_UP", 0xAF, L"" },
{ L"VK_MEDIA_NEXT_TRACK", 0xB0, L"" },
{ L"VK_MEDIA_PREV_TRACK", 0xB1, L"" },
{ L"VK_MEDIA_STOP", 0xB2, L"" },
{ L"VK_MEDIA_PLAY_PAUSE", 0xB3, L"" },
{ L"VK_LAUNCH_MAIL", 0xB4, L"" },
{ L"VK_LAUNCH_MEDIA_SELECT", 0xB5, L"" },
{ L"VK_LAUNCH_APP1", 0xB6, L"" },
{ L"VK_LAUNCH_APP2", 0xB7, L"" },
{ L"VK_OEM_1 (;:)", 0xBA, L"" },
{ L"VK_OEM_PLUS", 0xBB, L"+" },
{ L"VK_OEM_COMMA", 0xBC, L"" },
{ L"VK_OEM_MINUS", 0xBD, L"-" },
{ L"VK_OEM_PERIOD", 0xBE, L"." },
{ L"VK_OEM_2 (/?)", 0xBF, L"" },
{ L"VK_OEM_3 (`~)", 0xC0, L"~" },
{ L"VK_ATTN", 0xF6, L"" },
{ L"VK_CRSEL", 0xF7, L"" },
{ L"VK_EXSEL", 0xF8, L"" },
{ L"VK_EREOF", 0xF9, L"" },
{ L"VK_PLAY", 0xFA, L"" },
{ L"VK_ZOOM", 0xFB, L"" },
{ L"VK_NONAME", 0xFC, L"" },
{ L"VK_PA1", 0xFD, L"" },
{ L"VK_OEM_CLEAR", 0xFE, L"" }
};
CMenuShortCutKey::CMenuShortCutKey(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode, bool bUserAdded, bool bInactive) :
@ -176,7 +176,7 @@ CMenuShortCutKey::CMenuShortCutKey(WORD key, bool bCtrl, bool bAlt, bool bShift,
m_bUserAdded(bUserAdded),
m_bInactive(bInactive)
{
m_ShortCutName = "";
m_ShortCutName = L"";
for (int i = 0, n = sizeof(m_VirtualKeyList) / sizeof(m_VirtualKeyList[0]); i < n; i++)
{
if (key == m_VirtualKeyList[i].Key)
@ -185,9 +185,9 @@ CMenuShortCutKey::CMenuShortCutKey(WORD key, bool bCtrl, bool bAlt, bool bShift,
break;
}
}
if (m_bShift) { m_ShortCutName.Format("Shift+%s", m_ShortCutName.c_str()); }
if (m_bCtrl) { m_ShortCutName.Format("Ctrl+%s", m_ShortCutName.c_str()); }
if (m_bAlt) { m_ShortCutName.Format("Alt+%s", m_ShortCutName.c_str()); }
if (m_bShift) { m_ShortCutName = stdstr_f("Shift+%ls", m_ShortCutName.c_str()).ToUTF16(); }
if (m_bCtrl) { m_ShortCutName = stdstr_f("Ctrl+%ls", m_ShortCutName.c_str()).ToUTF16(); }
if (m_bAlt) { m_ShortCutName = stdstr_f("Alt+%s", m_ShortCutName.c_str()).ToUTF16(); }
}
VIRTUAL_KEY * CMenuShortCutKey::VirtualKeyList(int &Size)
@ -344,7 +344,7 @@ std::wstring CShortCuts::ShortCutString(int MenuID, CMenuShortCutKey::RUNNING_ST
{
continue;
}
return item->Name().ToUTF16();
return item->Name();
}
return L"";
}

View File

@ -12,9 +12,9 @@
struct VIRTUAL_KEY
{
LPCSTR Name;
int Key;
LPCSTR KeyName;
LPCTSTR Name;
int Key;
LPCTSTR KeyName;
};
class CMenuShortCutKey
@ -38,18 +38,6 @@ public:
ACCESS_ANYTIME = 7,
};
private:
static VIRTUAL_KEY m_VirtualKeyList[];
stdstr m_ShortCutName;
WORD m_key;
bool m_bCtrl;
bool m_bAlt;
bool m_bShift;
ACCESS_MODE m_AccessMode;
bool m_bUserAdded;
bool m_bInactive;
public:
CMenuShortCutKey(void);
CMenuShortCutKey(WORD key, bool bCtrl, bool bAlt, bool bShift, ACCESS_MODE AccessMode, bool bUserAdded, bool bInactive);
@ -59,16 +47,28 @@ public:
static VIRTUAL_KEY * VirtualKeyList(int &Size);
static RUNNING_STATE RunningState(void);
inline stdstr Name(void) const { return m_ShortCutName; }
inline WORD Key(void) const { return m_key; }
inline bool Ctrl(void) const { return m_bCtrl; }
inline bool Alt(void) const { return m_bAlt; }
inline bool Shift(void) const { return m_bShift; }
inline bool UserAdded(void) const { return m_bUserAdded; }
inline bool Inactive(void) const { return m_bInactive; }
inline const std::wstring & Name(void) const { return m_ShortCutName; }
inline WORD Key(void) const { return m_key; }
inline bool Ctrl(void) const { return m_bCtrl; }
inline bool Alt(void) const { return m_bAlt; }
inline bool Shift(void) const { return m_bShift; }
inline bool UserAdded(void) const { return m_bUserAdded; }
inline bool Inactive(void) const { return m_bInactive; }
inline ACCESS_MODE AccessMode(void) const { return m_AccessMode; }
inline void SetInactive(bool Inactive) { m_bInactive = Inactive; }
inline void SetInactive(bool Inactive) { m_bInactive = Inactive; }
private:
static VIRTUAL_KEY m_VirtualKeyList[];
std::wstring m_ShortCutName;
WORD m_key;
bool m_bCtrl;
bool m_bAlt;
bool m_bShift;
ACCESS_MODE m_AccessMode;
bool m_bUserAdded;
bool m_bInactive;
};
class CShortCutItem

View File

@ -40,7 +40,7 @@ CRomBrowser::~CRomBrowser(void)
void CRomBrowser::AddField(ROMBROWSER_FIELDS_LIST & Fields, LPCSTR Name, int32_t Pos, int32_t ID, int32_t Width, LanguageStringID LangID, bool UseDefault)
{
Fields.push_back(ROMBROWSER_FIELDS(Name, Pos, ID, Width * DPIScale(), LangID, UseDefault));
Fields.push_back(ROMBROWSER_FIELDS(Name, Pos, ID, (int)(Width * DPIScale()), LangID, UseDefault));
}
void CRomBrowser::GetFieldInfo(ROMBROWSER_FIELDS_LIST & Fields, bool UseDefault /* = false */)
@ -659,26 +659,26 @@ int32_t CALLBACK CRomBrowser::RomList_CompareItems(uint32_t lParam1, uint32_t lP
switch (SortFieldInfo->Key)
{
case RB_FileName: result = (int32_t)lstrcmpi(pRomInfo1->FileName, pRomInfo2->FileName); break;
case RB_InternalName: result = (int32_t)lstrcmpi(pRomInfo1->InternalName, pRomInfo2->InternalName); break;
case RB_GoodName: result = (int32_t)lstrcmpi(GoodName1, GoodName2); break;
case RB_Name: result = (int32_t)lstrcmpi(Name1, Name2); break;
case RB_Status: result = (int32_t)lstrcmpi(pRomInfo1->Status, pRomInfo2->Status); break;
case RB_FileName: result = (int32_t)lstrcmpiA(pRomInfo1->FileName, pRomInfo2->FileName); break;
case RB_InternalName: result = (int32_t)lstrcmpiA(pRomInfo1->InternalName, pRomInfo2->InternalName); break;
case RB_GoodName: result = (int32_t)lstrcmpiA(GoodName1, GoodName2); break;
case RB_Name: result = (int32_t)lstrcmpiA(Name1, Name2); break;
case RB_Status: result = (int32_t)lstrcmpiA(pRomInfo1->Status, pRomInfo2->Status); break;
case RB_RomSize: result = (int32_t)pRomInfo1->RomSize - (int32_t)pRomInfo2->RomSize; break;
case RB_CoreNotes: result = (int32_t)lstrcmpi(pRomInfo1->CoreNotes, pRomInfo2->CoreNotes); break;
case RB_PluginNotes: result = (int32_t)lstrcmpi(pRomInfo1->PluginNotes, pRomInfo2->PluginNotes); break;
case RB_UserNotes: result = (int32_t)lstrcmpi(pRomInfo1->UserNotes, pRomInfo2->UserNotes); break;
case RB_CartridgeID: result = (int32_t)lstrcmpi(pRomInfo1->CartID, pRomInfo2->CartID); break;
case RB_CoreNotes: result = (int32_t)lstrcmpiA(pRomInfo1->CoreNotes, pRomInfo2->CoreNotes); break;
case RB_PluginNotes: result = (int32_t)lstrcmpiA(pRomInfo1->PluginNotes, pRomInfo2->PluginNotes); break;
case RB_UserNotes: result = (int32_t)lstrcmpiA(pRomInfo1->UserNotes, pRomInfo2->UserNotes); break;
case RB_CartridgeID: result = (int32_t)lstrcmpiA(pRomInfo1->CartID, pRomInfo2->CartID); break;
case RB_Manufacturer: result = (int32_t)pRomInfo1->Manufacturer - (int32_t)pRomInfo2->Manufacturer; break;
case RB_Country: result = (int32_t)pRomInfo1->Country - (int32_t)pRomInfo2->Country; break;
case RB_Developer: result = (int32_t)lstrcmpi(pRomInfo1->Developer, pRomInfo2->Developer); break;
case RB_Developer: result = (int32_t)lstrcmpiA(pRomInfo1->Developer, pRomInfo2->Developer); break;
case RB_Crc1: result = (int32_t)pRomInfo1->CRC1 - (int32_t)pRomInfo2->CRC1; break;
case RB_Crc2: result = (int32_t)pRomInfo1->CRC2 - (int32_t)pRomInfo2->CRC2; break;
case RB_CICChip: result = (int32_t)pRomInfo1->CicChip - (int32_t)pRomInfo2->CicChip; break;
case RB_ReleaseDate: result = (int32_t)lstrcmpi(pRomInfo1->ReleaseDate, pRomInfo2->ReleaseDate); break;
case RB_ReleaseDate: result = (int32_t)lstrcmpiA(pRomInfo1->ReleaseDate, pRomInfo2->ReleaseDate); break;
case RB_Players: result = (int32_t)pRomInfo1->Players - (int32_t)pRomInfo2->Players; break;
case RB_ForceFeedback: result = (int32_t)lstrcmpi(pRomInfo1->ForceFeedback, pRomInfo2->ForceFeedback); break;
case RB_Genre: result = (int32_t)lstrcmpi(pRomInfo1->Genre, pRomInfo2->Genre); break;
case RB_ForceFeedback: result = (int32_t)lstrcmpiA(pRomInfo1->ForceFeedback, pRomInfo2->ForceFeedback); break;
case RB_Genre: result = (int32_t)lstrcmpiA(pRomInfo1->Genre, pRomInfo2->Genre); break;
case RB_FileFormat: result = (int32_t)pRomInfo1->FileFormat - (int32_t)pRomInfo2->FileFormat; break;
default: result = 0; break;
}
@ -991,7 +991,7 @@ void CRomBrowser::SelectRomDir(void)
{
WriteTrace(TraceUserInterface, TraceDebug, "3");
char Directory[_MAX_PATH];
if (SHGetPathFromIDList(pidl, Directory))
if (SHGetPathFromIDListA(pidl, Directory))
{
int32_t len = strlen(Directory);
@ -1177,7 +1177,7 @@ void CRomBrowser::WatchRomDirChanged(CRomBrowser * _this)
HANDLE hChange[] =
{
_this->m_WatchStopEvent,
FindFirstChangeNotification(_this->m_WatchRomDir.c_str(), g_Settings->LoadBool(RomList_GameDirRecursive), FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE),
FindFirstChangeNotificationA(_this->m_WatchRomDir.c_str(), g_Settings->LoadBool(RomList_GameDirRecursive), FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE),
};
WriteTrace(TraceUserInterface, TraceDebug, "4");
for (;;)

View File

@ -83,7 +83,7 @@ DWORD CALLBACK RomInfoProc(HWND hDlg, DWORD uMsg, DWORD wParam, DWORD lParam)
case WM_INITDIALOG:
{
//record class for future usage
SetProp(hDlg, "this", (RomInformation *)lParam);
SetProp(hDlg, L"this", (RomInformation *)lParam);
RomInformation * _this = (RomInformation *)lParam;
if (_this->m_pDiskInfo == NULL)
@ -240,11 +240,11 @@ DWORD CALLBACK RomInfoProc(HWND hDlg, DWORD uMsg, DWORD wParam, DWORD lParam)
switch (LOWORD(wParam))
{
case IDCANCEL:
RemoveProp(hDlg, "this");
RemoveProp(hDlg, L"this");
EndDialog(hDlg, 0);
break;
case IDC_CLOSE_BUTTON:
RemoveProp(hDlg, "this");
RemoveProp(hDlg, L"this");
EndDialog(hDlg, 0);
break;
}

View File

@ -20,13 +20,13 @@ CAdvancedOptionsPage::CAdvancedOptionsPage(HWND hParent, const RECT & rcDispay)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_START_ON_ROM_OPEN, wGS(ADVANCE_AUTO_START).c_str());
SetDlgItemTextW(m_hWnd, IDC_ZIP, wGS(ADVANCE_COMPRESS).c_str());
SetDlgItemTextW(m_hWnd, IDC_DEBUGGER, wGS(ADVANCE_DEBUGGER).c_str());
SetDlgItemTextW(m_hWnd, IDC_REMEMBER_CHEAT, wGS(OPTION_REMEMBER_CHEAT).c_str());
SetDlgItemTextW(m_hWnd, IDC_UNIQUE_SAVE_DIR, wGS(OPTION_UNIQUE_SAVE_DIR).c_str());
SetDlgItemTextW(m_hWnd, IDC_CHECK_RUNNING, wGS(OPTION_CHECK_RUNNING).c_str());
SetDlgItemTextW(m_hWnd, IDC_DISPLAY_FRAMERATE, wGS(OPTION_CHANGE_FR).c_str());
SetDlgItemText(IDC_START_ON_ROM_OPEN, wGS(ADVANCE_AUTO_START).c_str());
SetDlgItemText(IDC_ZIP, wGS(ADVANCE_COMPRESS).c_str());
SetDlgItemText(IDC_DEBUGGER, wGS(ADVANCE_DEBUGGER).c_str());
SetDlgItemText(IDC_REMEMBER_CHEAT, wGS(OPTION_REMEMBER_CHEAT).c_str());
SetDlgItemText(IDC_UNIQUE_SAVE_DIR, wGS(OPTION_UNIQUE_SAVE_DIR).c_str());
SetDlgItemText(IDC_CHECK_RUNNING, wGS(OPTION_CHECK_RUNNING).c_str());
SetDlgItemText(IDC_DISPLAY_FRAMERATE, wGS(OPTION_CHANGE_FR).c_str());
AddModCheckBox(GetDlgItem(IDC_START_ON_ROM_OPEN), Setting_AutoStart);
AddModCheckBox(GetDlgItem(IDC_ZIP), Setting_AutoZipInstantSave);
@ -41,10 +41,10 @@ CAdvancedOptionsPage::CAdvancedOptionsPage(HWND hParent, const RECT & rcDispay)
ComboBox = AddModComboBox(GetDlgItem(IDC_FRAME_DISPLAY_TYPE), UserInterface_FrameDisplayType);
if (ComboBox)
{
ComboBox->AddItemW(wGS(STR_FR_VIS).c_str(), FR_VIs);
ComboBox->AddItemW(wGS(STR_FR_DLS).c_str(), FR_DLs);
ComboBox->AddItemW(wGS(STR_FR_PERCENT).c_str(), FR_PERCENT);
ComboBox->AddItemW(wGS(STR_FR_DLS_VIS).c_str(), FR_VIs_DLs);
ComboBox->AddItem(wGS(STR_FR_VIS).c_str(), FR_VIs);
ComboBox->AddItem(wGS(STR_FR_DLS).c_str(), FR_DLs);
ComboBox->AddItem(wGS(STR_FR_PERCENT).c_str(), FR_PERCENT);
ComboBox->AddItem(wGS(STR_FR_DLS_VIS).c_str(), FR_VIs_DLs);
}
UpdatePageSettings();

View File

@ -19,38 +19,38 @@ CDefaultsOptionsPage::CDefaultsOptionsPage(HWND hParent, const RECT & rcDispay)
}
UpdatePageSettings();
SetDlgItemTextW(m_hWnd, IDC_MEMORY_SIZE_TEXT, wGS(ROM_MEM_SIZE).c_str());
SetDlgItemTextW(m_hWnd, IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
SetDlgItemTextW(m_hWnd, IDC_USE_TLB, wGS(ROM_USE_TLB).c_str());
SetDlgItemTextW(m_hWnd, IDC_VIREFESH_TEXT, wGS(ROM_VIREFRESH).c_str());
SetDlgItemTextW(m_hWnd, IDC_COUNTPERBYTE_TEXT, wGS(ROM_COUNTPERBYTE).c_str());
SetDlgItemTextW(m_hWnd, IDC_COUNTFACT_TEXT, wGS(ROM_COUNTER_FACTOR).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROM_32BIT, wGS(ROM_32BIT).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROM_FIXEDAUDIO, wGS(ROM_FIXED_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_UNALIGNED_DMA, wGS(ROM_UNALIGNED_DMA).c_str());
SetDlgItemTextW(m_hWnd, IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str());
SetDlgItemTextW(m_hWnd, IDC_PROTECT_MEMORY, wGS(ADVANCE_SMM_PROTECT).c_str());
SetDlgItemText(IDC_MEMORY_SIZE_TEXT, wGS(ROM_MEM_SIZE).c_str());
SetDlgItemText(IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
SetDlgItemText(IDC_USE_TLB, wGS(ROM_USE_TLB).c_str());
SetDlgItemText(IDC_VIREFESH_TEXT, wGS(ROM_VIREFRESH).c_str());
SetDlgItemText(IDC_COUNTPERBYTE_TEXT, wGS(ROM_COUNTPERBYTE).c_str());
SetDlgItemText(IDC_COUNTFACT_TEXT, wGS(ROM_COUNTER_FACTOR).c_str());
SetDlgItemText(IDC_ROM_32BIT, wGS(ROM_32BIT).c_str());
SetDlgItemText(IDC_ROM_FIXEDAUDIO, wGS(ROM_FIXED_AUDIO).c_str());
SetDlgItemText(IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
SetDlgItemText(IDC_UNALIGNED_DMA, wGS(ROM_UNALIGNED_DMA).c_str());
SetDlgItemText(IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str());
SetDlgItemText(IDC_PROTECT_MEMORY, wGS(ADVANCE_SMM_PROTECT).c_str());
CModifiedComboBox * ComboBox;
ComboBox = AddModComboBox(GetDlgItem(IDC_RDRAM_SIZE), Default_RDRamSize);
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_MEMORY_SIZE_TEXT));
ComboBox->AddItemW(wGS(RDRAM_4MB).c_str(), 0x400000);
ComboBox->AddItemW(wGS(RDRAM_8MB).c_str(), 0x800000);
ComboBox->AddItem(wGS(RDRAM_4MB).c_str(), 0x400000);
ComboBox->AddItem(wGS(RDRAM_8MB).c_str(), 0x800000);
}
ComboBox = AddModComboBox(GetDlgItem(IDC_COUNTFACT), Default_CounterFactor);
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_COUNTFACT_TEXT));
ComboBox->AddItemW(wGS(NUMBER_1).c_str(), 1);
ComboBox->AddItemW(wGS(NUMBER_2).c_str(), 2);
ComboBox->AddItemW(wGS(NUMBER_3).c_str(), 3);
ComboBox->AddItemW(wGS(NUMBER_4).c_str(), 4);
ComboBox->AddItemW(wGS(NUMBER_5).c_str(), 5);
ComboBox->AddItemW(wGS(NUMBER_6).c_str(), 6);
ComboBox->AddItem(wGS(NUMBER_1).c_str(), 1);
ComboBox->AddItem(wGS(NUMBER_2).c_str(), 2);
ComboBox->AddItem(wGS(NUMBER_3).c_str(), 3);
ComboBox->AddItem(wGS(NUMBER_4).c_str(), 4);
ComboBox->AddItem(wGS(NUMBER_5).c_str(), 5);
ComboBox->AddItem(wGS(NUMBER_6).c_str(), 6);
}
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_VIREFRESH), Default_ViRefreshRate, false);

View File

@ -93,7 +93,7 @@ void COptionsDirectoriesPage::SelectDirectory(LanguageStringID Title, CModifiedE
stdstr path;
CPath SelectedDir(path.FromUTF16(Directory), "");
EditBox.SetChanged(true);
EditBox.SetWindowText(SelectedDir);
EditBox.SetWindowText(stdstr((const char *)SelectedDir).ToUTF16().c_str());
Default.SetChanged(true);
Default.SetCheck(BST_UNCHECKED);
selected.SetCheck(BM_SETCHECK);
@ -168,15 +168,15 @@ void COptionsDirectoriesPage::UpdatePageSettings()
m_InUpdateSettings = true;
m_PluginDir.SetChanged(g_Settings->LoadStringVal(Directory_PluginSelected, Directory));
m_PluginDir.SetWindowText(Directory.c_str());
m_PluginDir.SetWindowText(Directory.ToUTF16().c_str());
m_AutoSaveDir.SetChanged(g_Settings->LoadStringVal(Directory_NativeSaveSelected, Directory));
m_AutoSaveDir.SetWindowText(Directory.c_str());
m_AutoSaveDir.SetWindowText(Directory.ToUTF16().c_str());
m_InstantSaveDir.SetChanged(g_Settings->LoadStringVal(Directory_InstantSaveSelected, Directory));
m_InstantSaveDir.SetWindowText(Directory.c_str());
m_InstantSaveDir.SetWindowText(Directory.ToUTF16().c_str());
m_ScreenShotDir.SetChanged(g_Settings->LoadStringVal(Directory_SnapShotSelected, Directory));
m_ScreenShotDir.SetWindowText(Directory.c_str());
m_ScreenShotDir.SetWindowText(Directory.ToUTF16().c_str());
m_TextureDir.SetChanged(g_Settings->LoadStringVal(Directory_TextureSelected, Directory));
m_TextureDir.SetWindowText(Directory.c_str());
m_TextureDir.SetWindowText(Directory.ToUTF16().c_str());
bool UseSelected;
m_PluginDefault.SetChanged(g_Settings->LoadBool(Directory_PluginUseSelected, UseSelected));
@ -253,7 +253,7 @@ void COptionsDirectoriesPage::ResetDirectory(CModifiedEditBox & EditBox, Setting
}
stdstr dir;
g_Settings->LoadDefaultString(Type, dir);
EditBox.SetWindowText(dir.c_str());
EditBox.SetWindowText(dir.ToUTF16().c_str());
EditBox.SetReset(true);
}

View File

@ -20,10 +20,10 @@ CDiskDrivePage::CDiskDrivePage(HWND hParent, const RECT & rcDispay)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_IPLDIR_JP_TXT, wGS(OPTION_IPL_ROM_PATH).c_str());
SetDlgItemTextW(m_hWnd, IDC_IPLDIR_US_TXT, wGS(OPTION_IPL_ROM_USA_PATH).c_str());
SetDlgItemTextW(m_hWnd, IDC_IPLDIR_TL_TXT, wGS(OPTION_IPL_ROM_TOOL_PATH).c_str());
SetDlgItemTextW(m_hWnd, IDC_DISKSAVETYPE_TXT, wGS(OPTION_DISKSAVETYPE).c_str());
SetDlgItemText(IDC_IPLDIR_JP_TXT, wGS(OPTION_IPL_ROM_PATH).c_str());
SetDlgItemText(IDC_IPLDIR_US_TXT, wGS(OPTION_IPL_ROM_USA_PATH).c_str());
SetDlgItemText(IDC_IPLDIR_TL_TXT, wGS(OPTION_IPL_ROM_TOOL_PATH).c_str());
SetDlgItemText(IDC_DISKSAVETYPE_TXT, wGS(OPTION_DISKSAVETYPE).c_str());
m_IplDirJp.Attach(GetDlgItem(IDC_IPL_JP_DIR));
m_IplDirUs.Attach(GetDlgItem(IDC_IPL_US_DIR));
@ -33,8 +33,8 @@ CDiskDrivePage::CDiskDrivePage(HWND hParent, const RECT & rcDispay)
ComboBox = AddModComboBox(GetDlgItem(IDC_DISKSAVETYPE), Setting_DiskSaveType);
if (ComboBox)
{
ComboBox->AddItemW(wGS(DISKSAVE_SHADOW).c_str(), SaveDisk_ShadowFile);
ComboBox->AddItemW(wGS(DISKSAVE_RAM).c_str(), SaveDisk_RAMFile);
ComboBox->AddItem(wGS(DISKSAVE_SHADOW).c_str(), SaveDisk_ShadowFile);
ComboBox->AddItem(wGS(DISKSAVE_RAM).c_str(), SaveDisk_RAMFile);
}
UpdatePageSettings();
@ -139,11 +139,11 @@ void CDiskDrivePage::UpdatePageSettings(void)
stdstr File;
g_Settings->LoadStringVal(File_DiskIPLPath, File);
m_IplDirJp.SetWindowText(File.c_str());
m_IplDirJp.SetWindowText(File.ToUTF16().c_str());
g_Settings->LoadStringVal(File_DiskIPLUSAPath, File);
m_IplDirUs.SetWindowText(File.c_str());
m_IplDirUs.SetWindowText(File.ToUTF16().c_str());
g_Settings->LoadStringVal(File_DiskIPLTOOLPath, File);
m_IplDirTl.SetWindowText(File.c_str());
m_IplDirTl.SetWindowText(File.ToUTF16().c_str());
m_InUpdateSettings = false;
}
@ -156,7 +156,7 @@ void CDiskDrivePage::SelectFile(LanguageStringID /*Title*/, CModifiedEditBox & E
if (FileName.SelectFile(m_hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
{
EditBox.SetChanged(true);
EditBox.SetWindowText(FileName);
EditBox.SetWindowText(stdstr((const char *)FileName).ToUTF16().c_str());
SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0);
}
}

View File

@ -21,24 +21,24 @@ CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_GOOD_NAME_TEXT, wGS(RB_GOODNAME).c_str());
SetDlgItemText(IDC_GOOD_NAME_TEXT, wGS(RB_GOODNAME).c_str());
SetDlgItemTextW(m_hWnd, IDC_MEMORY_SIZE_TEXT, wGS(ROM_MEM_SIZE).c_str());
SetDlgItemTextW(m_hWnd, IDC_SAVE_TYPE_TEXT, wGS(ROM_SAVE_TYPE).c_str());
SetDlgItemTextW(m_hWnd, IDC_COUNTFACT_TEXT, wGS(ROM_COUNTER_FACTOR).c_str());
SetDlgItemTextW(m_hWnd, IDC_VIREFESH_TEXT, wGS(ROM_VIREFRESH).c_str());
SetDlgItemTextW(m_hWnd, IDC_COUNTPERBYTE_TEXT, wGS(ROM_COUNTPERBYTE).c_str());
SetDlgItemTextW(m_hWnd, IDC_OVER_CLOCK_MODIFIER_TEXT, wGS(ROM_OVER_CLOCK_MODIFIER).c_str());
SetDlgItemText(IDC_MEMORY_SIZE_TEXT, wGS(ROM_MEM_SIZE).c_str());
SetDlgItemText(IDC_SAVE_TYPE_TEXT, wGS(ROM_SAVE_TYPE).c_str());
SetDlgItemText(IDC_COUNTFACT_TEXT, wGS(ROM_COUNTER_FACTOR).c_str());
SetDlgItemText(IDC_VIREFESH_TEXT, wGS(ROM_VIREFRESH).c_str());
SetDlgItemText(IDC_COUNTPERBYTE_TEXT, wGS(ROM_COUNTPERBYTE).c_str());
SetDlgItemText(IDC_OVER_CLOCK_MODIFIER_TEXT, wGS(ROM_OVER_CLOCK_MODIFIER).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROM_32BIT, wGS(ROM_32BIT).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROM_FIXEDAUDIO, wGS(ROM_FIXED_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_DELAY_DP, wGS(ROM_DELAY_DP).c_str());
SetDlgItemTextW(m_hWnd, IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_USE_TLB, wGS(ROM_USE_TLB).c_str());
SetDlgItemTextW(m_hWnd, IDC_DELAY_SI, wGS(ROM_DELAY_SI).c_str());
SetDlgItemTextW(m_hWnd, IDC_AUDIO_SIGNAL, wGS(ROM_AUDIO_SIGNAL).c_str());
SetDlgItemTextW(m_hWnd, IDC_UNALIGNED_DMA, wGS(ROM_UNALIGNED_DMA).c_str());
SetDlgItemTextW(m_hWnd, IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str());
SetDlgItemText(IDC_ROM_32BIT, wGS(ROM_32BIT).c_str());
SetDlgItemText(IDC_ROM_FIXEDAUDIO, wGS(ROM_FIXED_AUDIO).c_str());
SetDlgItemText(IDC_DELAY_DP, wGS(ROM_DELAY_DP).c_str());
SetDlgItemText(IDC_SYNC_AUDIO, wGS(ROM_SYNC_AUDIO).c_str());
SetDlgItemText(IDC_USE_TLB, wGS(ROM_USE_TLB).c_str());
SetDlgItemText(IDC_DELAY_SI, wGS(ROM_DELAY_SI).c_str());
SetDlgItemText(IDC_AUDIO_SIGNAL, wGS(ROM_AUDIO_SIGNAL).c_str());
SetDlgItemText(IDC_UNALIGNED_DMA, wGS(ROM_UNALIGNED_DMA).c_str());
SetDlgItemText(IDC_RANDOMIZE_SIPI_INTERRUPTS, wGS(ROM_RANDOMIZE_SIPI_INTERRUPTS).c_str());
AddModCheckBox(GetDlgItem(IDC_ROM_32BIT), Game_32Bit);
AddModCheckBox(GetDlgItem(IDC_SYNC_AUDIO), Game_SyncViaAudio);
@ -55,34 +55,34 @@ CGameGeneralPage::CGameGeneralPage(HWND hParent, const RECT & rcDispay)
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_MEMORY_SIZE_TEXT));
ComboBox->AddItemW(wGS(RDRAM_4MB).c_str(), 0x400000);
ComboBox->AddItemW(wGS(RDRAM_8MB).c_str(), 0x800000);
ComboBox->AddItem(wGS(RDRAM_4MB).c_str(), 0x400000);
ComboBox->AddItem(wGS(RDRAM_8MB).c_str(), 0x800000);
}
ComboBox = AddModComboBox(GetDlgItem(IDC_SAVE_TYPE), Game_SaveChip);
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_SAVE_TYPE_TEXT));
ComboBox->AddItemW(wGS(SAVE_FIRST_USED).c_str(), (uint32_t)(int64_t)SaveChip_Auto);
ComboBox->AddItemW(wGS(SAVE_4K_EEPROM).c_str(), SaveChip_Eeprom_4K);
ComboBox->AddItemW(wGS(SAVE_16K_EEPROM).c_str(), SaveChip_Eeprom_16K);
ComboBox->AddItemW(wGS(SAVE_SRAM).c_str(), SaveChip_Sram);
ComboBox->AddItemW(wGS(SAVE_FLASHRAM).c_str(), SaveChip_FlashRam);
ComboBox->AddItem(wGS(SAVE_FIRST_USED).c_str(), (uint32_t)(int64_t)SaveChip_Auto);
ComboBox->AddItem(wGS(SAVE_4K_EEPROM).c_str(), SaveChip_Eeprom_4K);
ComboBox->AddItem(wGS(SAVE_16K_EEPROM).c_str(), SaveChip_Eeprom_16K);
ComboBox->AddItem(wGS(SAVE_SRAM).c_str(), SaveChip_Sram);
ComboBox->AddItem(wGS(SAVE_FLASHRAM).c_str(), SaveChip_FlashRam);
}
ComboBox = AddModComboBox(GetDlgItem(IDC_COUNTFACT), Game_CounterFactor);
if (ComboBox)
{
ComboBox->SetTextField(GetDlgItem(IDC_COUNTFACT_TEXT));
ComboBox->AddItemW(wGS(NUMBER_1).c_str(), 1);
ComboBox->AddItemW(wGS(NUMBER_2).c_str(), 2);
ComboBox->AddItemW(wGS(NUMBER_3).c_str(), 3);
ComboBox->AddItemW(wGS(NUMBER_4).c_str(), 4);
ComboBox->AddItemW(wGS(NUMBER_5).c_str(), 5);
ComboBox->AddItemW(wGS(NUMBER_6).c_str(), 6);
ComboBox->AddItem(wGS(NUMBER_1).c_str(), 1);
ComboBox->AddItem(wGS(NUMBER_2).c_str(), 2);
ComboBox->AddItem(wGS(NUMBER_3).c_str(), 3);
ComboBox->AddItem(wGS(NUMBER_4).c_str(), 4);
ComboBox->AddItem(wGS(NUMBER_5).c_str(), 5);
ComboBox->AddItem(wGS(NUMBER_6).c_str(), 6);
}
SetDlgItemText(IDC_GOOD_NAME, g_Settings->LoadStringVal(Rdb_GoodName).c_str());
SetDlgItemText(IDC_GOOD_NAME, stdstr(g_Settings->LoadStringVal(Rdb_GoodName)).ToUTF16().c_str());
CModifiedEditBox * TxtBox = AddModTextBox(GetDlgItem(IDC_VIREFRESH), Game_ViRefreshRate, false);
TxtBox->SetTextField(GetDlgItem(IDC_VIREFESH_TEXT));

View File

@ -21,18 +21,18 @@ CGamePluginPage::CGamePluginPage(HWND hParent, const RECT & rcDispay)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, RSP_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, GFX_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, AUDIO_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, CONT_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(RSP_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(GFX_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(AUDIO_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(CONT_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, IDC_RSP_NAME, wGS(PLUG_RSP).c_str());
SetDlgItemTextW(m_hWnd, IDC_GFX_NAME, wGS(PLUG_GFX).c_str());
SetDlgItemTextW(m_hWnd, IDC_AUDIO_NAME, wGS(PLUG_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_CONT_NAME, wGS(PLUG_CTRL).c_str());
SetDlgItemText(IDC_RSP_NAME, wGS(PLUG_RSP).c_str());
SetDlgItemText(IDC_GFX_NAME, wGS(PLUG_GFX).c_str());
SetDlgItemText(IDC_AUDIO_NAME, wGS(PLUG_AUDIO).c_str());
SetDlgItemText(IDC_CONT_NAME, wGS(PLUG_CTRL).c_str());
SetDlgItemTextW(m_hWnd, IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
SetDlgItemTextW(m_hWnd, IDC_HLE_AUDIO, wGS(PLUG_HLE_AUDIO).c_str());
SetDlgItemText(IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
SetDlgItemText(IDC_HLE_AUDIO, wGS(PLUG_HLE_AUDIO).c_str());
m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME));
m_AudioGroup.Attach(GetDlgItem(IDC_AUDIO_NAME));
@ -61,7 +61,7 @@ void CGamePluginPage::AddPlugins(int ListId, SettingID Type, PLUGIN_TYPE PluginT
{
ComboBox->SetDefault(NULL);
}
ComboBox->AddItemW(wGS(PLUG_DEFAULT).c_str(), NULL);
ComboBox->AddItem(wGS(PLUG_DEFAULT).c_str(), NULL);
for (int i = 0, n = m_PluginList.GetPluginCount(); i < n; i++)
{
@ -78,7 +78,7 @@ void CGamePluginPage::AddPlugins(int ListId, SettingID Type, PLUGIN_TYPE PluginT
{
ComboBox->SetDefault((WPARAM)Plugin);
}
ComboBox->AddItem(Plugin->Info.Name, (WPARAM)Plugin);
ComboBox->AddItem(stdstr(Plugin->Info.Name).ToUTF16().c_str(), (WPARAM)Plugin);
}
}
@ -118,7 +118,7 @@ void CGamePluginPage::ShowAboutButton(int id)
//Load the plugin
UINT LastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
HMODULE hLib = LoadLibrary(Plugin->FullPath);
HMODULE hLib = LoadLibrary(stdstr((const char *)Plugin->FullPath).ToUTF16().c_str());
SetErrorMode(LastErrorMode);
if (hLib == NULL)
{

View File

@ -21,19 +21,19 @@ CGameRecompilePage::CGameRecompilePage(HWND hParent, const RECT & rcDispay)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_CPU_TYPE_TEXT, wGS(ROM_CPU_STYLE).c_str());
SetDlgItemTextW(m_hWnd, IDC_FUNCFIND_TEXT, wGS(ROM_FUNC_FIND).c_str());
SetDlgItemText(IDC_CPU_TYPE_TEXT, wGS(ROM_CPU_STYLE).c_str());
SetDlgItemText(IDC_FUNCFIND_TEXT, wGS(ROM_FUNC_FIND).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROM_REGCACHE, wGS(ROM_REG_CACHE).c_str());
SetDlgItemTextW(m_hWnd, IDC_BLOCK_LINKING, wGS(ADVANCE_ABL).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROM_FASTSP, wGS(ROM_FAST_SP).c_str());
SetDlgItemText(IDC_ROM_REGCACHE, wGS(ROM_REG_CACHE).c_str());
SetDlgItemText(IDC_BLOCK_LINKING, wGS(ADVANCE_ABL).c_str());
SetDlgItemText(IDC_ROM_FASTSP, wGS(ROM_FAST_SP).c_str());
SetDlgItemTextW(m_hWnd, IDC_SMM_FRAME, wGS(ADVANCE_SMCM).c_str());
SetDlgItemTextW(m_hWnd, IDC_SMM_CACHE, wGS(ADVANCE_SMM_CACHE).c_str());
SetDlgItemTextW(m_hWnd, IDC_SMM_DMA, wGS(ADVANCE_SMM_PIDMA).c_str());
SetDlgItemTextW(m_hWnd, IDC_SMM_VALIDATE, wGS(ADVANCE_SMM_VALIDATE).c_str());
SetDlgItemTextW(m_hWnd, IDC_SMM_TLB, wGS(ADVANCE_SMM_TLB).c_str());
SetDlgItemTextW(m_hWnd, IDC_SMM_PROTECT, wGS(ADVANCE_SMM_PROTECT).c_str());
SetDlgItemText(IDC_SMM_FRAME, wGS(ADVANCE_SMCM).c_str());
SetDlgItemText(IDC_SMM_CACHE, wGS(ADVANCE_SMM_CACHE).c_str());
SetDlgItemText(IDC_SMM_DMA, wGS(ADVANCE_SMM_PIDMA).c_str());
SetDlgItemText(IDC_SMM_VALIDATE, wGS(ADVANCE_SMM_VALIDATE).c_str());
SetDlgItemText(IDC_SMM_TLB, wGS(ADVANCE_SMM_TLB).c_str());
SetDlgItemText(IDC_SMM_PROTECT, wGS(ADVANCE_SMM_PROTECT).c_str());
m_SelfModGroup.Attach(GetDlgItem(IDC_SMM_FRAME));
@ -52,19 +52,19 @@ CGameRecompilePage::CGameRecompilePage(HWND hParent, const RECT & rcDispay)
ComboBox = AddModComboBox(GetDlgItem(IDC_CPU_TYPE), Game_CpuType);
if (ComboBox)
{
ComboBox->AddItemW(wGS(CORE_RECOMPILER).c_str(), CPU_Recompiler);
ComboBox->AddItemW(wGS(CORE_INTERPTER).c_str(), CPU_Interpreter);
ComboBox->AddItem(wGS(CORE_RECOMPILER).c_str(), CPU_Recompiler);
ComboBox->AddItem(wGS(CORE_INTERPTER).c_str(), CPU_Interpreter);
if (g_Settings->LoadBool(Debugger_Enabled))
{
ComboBox->AddItemW(wGS(CORE_SYNC).c_str(), CPU_SyncCores);
ComboBox->AddItem(wGS(CORE_SYNC).c_str(), CPU_SyncCores);
}
}
ComboBox = AddModComboBox(GetDlgItem(IDC_FUNCFIND), Game_FuncLookupMode);
if (ComboBox)
{
ComboBox->AddItemW(wGS(FLM_PLOOKUP).c_str(), FuncFind_PhysicalLookup);
ComboBox->AddItemW(wGS(FLM_VLOOKUP).c_str(), FuncFind_VirtualLookup);
ComboBox->AddItem(wGS(FLM_PLOOKUP).c_str(), FuncFind_PhysicalLookup);
ComboBox->AddItem(wGS(FLM_VLOOKUP).c_str(), FuncFind_VirtualLookup);
//ComboBox->AddItem(wGS(FLM_CHANGEMEM).c_str(), FuncFind_ChangeMemory);
}
UpdatePageSettings();

View File

@ -33,7 +33,7 @@ CGameStatusPage::CGameStatusPage(HWND hParent, const RECT & rcDispay)
{
if (strstr(item->c_str(), ".Sel") != NULL) { continue; }
if (strstr(item->c_str(), ".Auto") != NULL) { continue; }
ComboBox->AddItem(item->c_str(), item->c_str());
ComboBox->AddItem(stdstr(*item).ToUTF16().c_str(), item->c_str());
}
ComboBox->SetTextField(GetDlgItem(IDC_STATUS_TEXT));
}

View File

@ -21,17 +21,17 @@ COptionsGameBrowserPage::COptionsGameBrowserPage(HWND hParent, const RECT & rcDi
return;
}
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT2, wGS(RB_ROMS).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT4, wGS(RB_DIRS).c_str());
SetDlgItemTextW(m_hWnd, IDC_USE_ROMBROWSER, wGS(RB_USE).c_str());
SetDlgItemTextW(m_hWnd, IDC_RECURSION, wGS(RB_DIR_RECURSION).c_str());
SetDlgItemTextW(m_hWnd, IDC_SHOW_FILE_EXTENSIONS, wGS(RB_FILEEXT).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT5, wGS(RB_AVALIABLE_FIELDS).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT6, wGS(RB_SHOW_FIELDS).c_str());
SetDlgItemTextW(m_hWnd, IDC_ADD, wGS(RB_ADD).c_str());
SetDlgItemTextW(m_hWnd, IDC_REMOVE, wGS(RB_REMOVE).c_str());
SetDlgItemTextW(m_hWnd, IDC_UP, wGS(RB_UP).c_str());
SetDlgItemTextW(m_hWnd, IDC_DOWN, wGS(RB_DOWN).c_str());
SetDlgItemText(IDC_ROMSEL_TEXT2, wGS(RB_ROMS).c_str());
SetDlgItemText(IDC_ROMSEL_TEXT4, wGS(RB_DIRS).c_str());
SetDlgItemText(IDC_USE_ROMBROWSER, wGS(RB_USE).c_str());
SetDlgItemText(IDC_RECURSION, wGS(RB_DIR_RECURSION).c_str());
SetDlgItemText(IDC_SHOW_FILE_EXTENSIONS, wGS(RB_FILEEXT).c_str());
SetDlgItemText(IDC_ROMSEL_TEXT5, wGS(RB_AVALIABLE_FIELDS).c_str());
SetDlgItemText(IDC_ROMSEL_TEXT6, wGS(RB_SHOW_FIELDS).c_str());
SetDlgItemText(IDC_ADD, wGS(RB_ADD).c_str());
SetDlgItemText(IDC_REMOVE, wGS(RB_REMOVE).c_str());
SetDlgItemText(IDC_UP, wGS(RB_UP).c_str());
SetDlgItemText(IDC_DOWN, wGS(RB_DOWN).c_str());
AddModCheckBox(GetDlgItem(IDC_USE_ROMBROWSER), RomBrowser_Enabled);
AddModCheckBox(GetDlgItem(IDC_RECURSION), RomList_GameDirRecursive);

View File

@ -20,14 +20,14 @@ COptionsShortCutsPage::COptionsShortCutsPage(HWND hParent, const RECT & rcDispay
return;
}
SetDlgItemTextW(m_hWnd, IDC_S_CPU_STATE, wGS(ACCEL_CPUSTATE_TITLE).c_str());
SetDlgItemTextW(m_hWnd, IDC_MENU_ITEM_TEXT, wGS(ACCEL_MENUITEM_TITLE).c_str());
SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_KEYS, wGS(ACCEL_CURRENTKEYS_TITLE).c_str());
SetDlgItemTextW(m_hWnd, IDC_S_SELECT_SHORT, wGS(ACCEL_SELKEY_TITLE).c_str());
SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_ASSIGN, wGS(ACCEL_ASSIGNEDTO_TITLE).c_str());
SetDlgItemTextW(m_hWnd, IDC_ASSIGN, wGS(ACCEL_ASSIGN_BTN).c_str());
SetDlgItemTextW(m_hWnd, IDC_REMOVE, wGS(ACCEL_REMOVE_BTN).c_str());
SetDlgItemTextW(m_hWnd, IDC_KEY_PROMPT, wGS(ACCEL_DETECTKEY).c_str());
SetDlgItemText(IDC_S_CPU_STATE, wGS(ACCEL_CPUSTATE_TITLE).c_str());
SetDlgItemText(IDC_MENU_ITEM_TEXT, wGS(ACCEL_MENUITEM_TITLE).c_str());
SetDlgItemText(IDC_S_CURRENT_KEYS, wGS(ACCEL_CURRENTKEYS_TITLE).c_str());
SetDlgItemText(IDC_S_SELECT_SHORT, wGS(ACCEL_SELKEY_TITLE).c_str());
SetDlgItemText(IDC_S_CURRENT_ASSIGN, wGS(ACCEL_ASSIGNEDTO_TITLE).c_str());
SetDlgItemText(IDC_ASSIGN, wGS(ACCEL_ASSIGN_BTN).c_str());
SetDlgItemText(IDC_REMOVE, wGS(ACCEL_REMOVE_BTN).c_str());
SetDlgItemText(IDC_KEY_PROMPT, wGS(ACCEL_DETECTKEY).c_str());
m_CreateNewShortCut.AttachToDlgItem(m_hWnd, IDC_S_SELECT_SHORT);
m_CpuState.Attach(GetDlgItem(IDC_C_CPU_STATE));
@ -245,7 +245,7 @@ void COptionsShortCutsPage::OnShortCutChanged(UINT /*Code*/, int /*id*/, HWND /*
{
str = "None";
}
SetDlgItemText(IDC_ASSIGNED_MENU_ITEM, str.c_str());
SetDlgItemText(IDC_ASSIGNED_MENU_ITEM, str.ToUTF16().c_str());
}
LRESULT COptionsShortCutsPage::OnMenuItemChanged(LPNMHDR lpnmh)
@ -275,7 +275,7 @@ void COptionsShortCutsPage::RefreshShortCutOptions(HTREEITEM hItem)
continue;
}
stdstr Name = ShortCut_item->Name();
const std::wstring & Name = ShortCut_item->Name();
m_CurrentKeys.SetItemData(m_CurrentKeys.AddString(Name.c_str()), (DWORD_PTR)&*ShortCut_item);
}
}

View File

@ -21,15 +21,15 @@ m_SettingsConfig(SettingsConfig)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_AUTOSLEEP, wGS(OPTION_AUTO_SLEEP).c_str());
SetDlgItemTextW(m_hWnd, IDC_LOAD_FULLSCREEN, wGS(OPTION_AUTO_FULLSCREEN).c_str());
SetDlgItemTextW(m_hWnd, IDC_SCREEN_SAVER, wGS(OPTION_DISABLE_SS).c_str());
SetDlgItemTextW(m_hWnd, IDC_BASIC_MODE, wGS(OPTION_BASIC_MODE).c_str());
SetDlgItemTextW(m_hWnd, IDC_MAXROMS_TXT, wGS(RB_MAX_ROMS).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT2, wGS(RB_ROMS).c_str());
SetDlgItemTextW(m_hWnd, IDC_MAXROMDIR_TXT, wGS(RB_MAX_DIRS).c_str());
SetDlgItemTextW(m_hWnd, IDC_ROMSEL_TEXT4, wGS(RB_DIRS).c_str());
SetDlgItemTextW(m_hWnd, IDC_IPLDIR_TXT, wGS(OPTION_IPL_ROM_PATH).c_str());
SetDlgItemText(IDC_AUTOSLEEP, wGS(OPTION_AUTO_SLEEP).c_str());
SetDlgItemText(IDC_LOAD_FULLSCREEN, wGS(OPTION_AUTO_FULLSCREEN).c_str());
SetDlgItemText(IDC_SCREEN_SAVER, wGS(OPTION_DISABLE_SS).c_str());
SetDlgItemText(IDC_BASIC_MODE, wGS(OPTION_BASIC_MODE).c_str());
SetDlgItemText(IDC_MAXROMS_TXT, wGS(RB_MAX_ROMS).c_str());
SetDlgItemText(IDC_ROMSEL_TEXT2, wGS(RB_ROMS).c_str());
SetDlgItemText(IDC_MAXROMDIR_TXT, wGS(RB_MAX_DIRS).c_str());
SetDlgItemText(IDC_ROMSEL_TEXT4, wGS(RB_DIRS).c_str());
SetDlgItemText(IDC_IPLDIR_TXT, wGS(OPTION_IPL_ROM_PATH).c_str());
AddModCheckBox(GetDlgItem(IDC_AUTOSLEEP), Setting_AutoSleep);
AddModCheckBox(GetDlgItem(IDC_LOAD_FULLSCREEN), Setting_AutoFullscreen);

View File

@ -20,18 +20,18 @@ COptionPluginPage::COptionPluginPage(HWND hParent, const RECT & rcDispay)
}
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, RSP_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, GFX_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, AUDIO_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, CONT_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(RSP_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(GFX_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(AUDIO_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemText(CONT_ABOUT, wGS(PLUG_ABOUT).c_str());
SetDlgItemTextW(m_hWnd, IDC_RSP_NAME, wGS(PLUG_RSP).c_str());
SetDlgItemTextW(m_hWnd, IDC_GFX_NAME, wGS(PLUG_GFX).c_str());
SetDlgItemTextW(m_hWnd, IDC_AUDIO_NAME, wGS(PLUG_AUDIO).c_str());
SetDlgItemTextW(m_hWnd, IDC_CONT_NAME, wGS(PLUG_CTRL).c_str());
SetDlgItemText(IDC_RSP_NAME, wGS(PLUG_RSP).c_str());
SetDlgItemText(IDC_GFX_NAME, wGS(PLUG_GFX).c_str());
SetDlgItemText(IDC_AUDIO_NAME, wGS(PLUG_AUDIO).c_str());
SetDlgItemText(IDC_CONT_NAME, wGS(PLUG_CTRL).c_str());
SetDlgItemTextW(m_hWnd, IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
SetDlgItemTextW(m_hWnd, IDC_HLE_AUDIO, wGS(PLUG_HLE_AUDIO).c_str());
SetDlgItemText(IDC_HLE_GFX, wGS(PLUG_HLE_GFX).c_str());
SetDlgItemText(IDC_HLE_AUDIO, wGS(PLUG_HLE_AUDIO).c_str());
m_GfxGroup.Attach(GetDlgItem(IDC_GFX_NAME));
m_AudioGroup.Attach(GetDlgItem(IDC_AUDIO_NAME));
@ -70,7 +70,7 @@ void COptionPluginPage::AddPlugins(int ListId, SettingID Type, PLUGIN_TYPE Plugi
{
ComboBox->SetDefault((WPARAM)Plugin);
}
ComboBox->AddItem(Plugin->Info.Name, (WPARAM)Plugin);
ComboBox->AddItem(stdstr(Plugin->Info.Name).ToUTF16().c_str(), (WPARAM)Plugin);
}
}
@ -110,7 +110,7 @@ void COptionPluginPage::ShowAboutButton(int id)
//Load the plugin
UINT LastErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
HMODULE hLib = LoadLibrary(Plugin->FullPath);
HMODULE hLib = LoadLibrary(stdstr((const char *)(Plugin->FullPath)).ToUTF16().c_str());
SetErrorMode(LastErrorMode);
if (hLib == NULL)
{

View File

@ -154,13 +154,13 @@ protected:
if (EditBox.IsbString())
{
stdstr Value = g_Settings->LoadDefaultString(Type);
EditBox.SetWindowText(Value.c_str());
EditBox.SetWindowText(Value.ToUTF16().c_str());
EditBox.SetReset(true);
}
else
{
DWORD Value = g_Settings->LoadDefaultDword(Type);
EditBox.SetWindowText(stdstr_f("%d", Value).c_str());
EditBox.SetWindowText(stdstr_f("%d", Value).ToUTF16().c_str());
EditBox.SetReset(true);
}
return true;
@ -295,13 +295,13 @@ protected:
{
stdstr SelectedValue;
TextBox->SetChanged(g_Settings->LoadStringVal(iter->first, SelectedValue));
TextBox->SetWindowText(SelectedValue.c_str());
TextBox->SetWindowText(SelectedValue.ToUTF16().c_str());
}
else
{
uint32_t SelectedValue;
TextBox->SetChanged(g_Settings->LoadDword(iter->first, SelectedValue));
TextBox->SetWindowText(stdstr_f("%d", SelectedValue).c_str());
TextBox->SetWindowText(stdstr_f("%d", SelectedValue).ToUTF16().c_str());
}
m_UpdatingTxt = false;
}

View File

@ -93,28 +93,28 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
CConfigSettingSection * SettingsSection;
//Set the text for all gui Items
SetDlgItemTextW(m_hWnd, IDC_RESET_PAGE, wGS(BOTTOM_RESET_PAGE).c_str());
SetDlgItemTextW(m_hWnd, IDC_RESET_ALL, wGS(BOTTOM_RESET_ALL).c_str());
SetDlgItemTextW(m_hWnd, IDOK, wGS(CHEAT_OK).c_str());
SetDlgItemTextW(m_hWnd, IDCANCEL, wGS(CHEAT_CANCEL).c_str());
SetDlgItemTextW(m_hWnd, IDAPPLY, wGS(BOTTOM_APPLY).c_str());
SetDlgItemText(IDC_RESET_PAGE, wGS(BOTTOM_RESET_PAGE).c_str());
SetDlgItemText(IDC_RESET_ALL, wGS(BOTTOM_RESET_ALL).c_str());
SetDlgItemText(IDOK, wGS(CHEAT_OK).c_str());
SetDlgItemText(IDCANCEL, wGS(CHEAT_CANCEL).c_str());
SetDlgItemText(IDAPPLY, wGS(BOTTOM_APPLY).c_str());
if (m_GameConfig)
{
if (g_Settings->LoadBool(Setting_RdbEditor))
{
SetWindowText(stdstr_f("%s ** RDB Edit Mode **", ConfigRomTitle.c_str()).c_str());
SetWindowText(stdstr_f("%s ** RDB Edit Mode **", ConfigRomTitle.c_str()).ToUTF16().c_str());
}
else
{
SetWindowText(ConfigRomTitle.c_str());
SetWindowText(ConfigRomTitle.ToUTF16().c_str());
}
}
else
{
if (g_Settings->LoadBool(Setting_RdbEditor))
{
SetWindowTextW(m_hWnd, stdstr_f("%s ** RDB Edit Mode **", GS(OPTIONS_TITLE)).ToUTF16().c_str());
SetWindowText(stdstr_f("%s ** RDB Edit Mode **", GS(OPTIONS_TITLE)).ToUTF16().c_str());
}
else
{

View File

@ -5,10 +5,10 @@
LRESULT CSupportEnterCode::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
SetWindowTextW(m_hWnd, wGS(MSG_SUPPORT_ENTER_CODE_TITLE).c_str());
SetWindowTextW(GetDlgItem(IDOK), wGS(MSG_SUPPORT_OK).c_str());
SetWindowTextW(GetDlgItem(IDCANCEL), wGS(MSG_SUPPORT_CANCEL).c_str());
SetWindowTextW(GetDlgItem(IDC_DESCRIPTION), wGS(MSG_SUPPORT_ENTER_CODE_DESC).c_str());
::SetWindowTextW(m_hWnd, wGS(MSG_SUPPORT_ENTER_CODE_TITLE).c_str());
::SetWindowTextW(GetDlgItem(IDOK), wGS(MSG_SUPPORT_OK).c_str());
::SetWindowTextW(GetDlgItem(IDCANCEL), wGS(MSG_SUPPORT_CANCEL).c_str());
::SetWindowTextW(GetDlgItem(IDC_DESCRIPTION), wGS(MSG_SUPPORT_ENTER_CODE_DESC).c_str());
return TRUE;
}
@ -42,20 +42,20 @@ LRESULT CSupportEnterCode::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWn
LRESULT CSupportEnterCode::OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
char code[50];
if (!GetDlgItemText(IDC_CODE,code,sizeof(code)))
wchar_t code[50];
if (!GetDlgItemText(IDC_CODE,code,sizeof(code) /sizeof(code[0])))
{
MessageBoxW(m_hWnd, wGS(MSG_SUPPORT_ENTER_SUPPORT_CODE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK);
MessageBox(wGS(MSG_SUPPORT_ENTER_SUPPORT_CODE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK);
return false;
}
if (_stricmp(code,"thank you from project64") != 0)
if (_wcsicmp(code,L"thank you from project64") != 0)
{
MessageBoxW(m_hWnd, wGS(MSG_SUPPORT_INCORRECT_CODE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK);
MessageBox(wGS(MSG_SUPPORT_INCORRECT_CODE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK);
return false;
}
UISettingsSaveDword(SupportWindows_RunCount, (uint32_t) -1);
CSettingTypeApplication::Flush();
MessageBoxW(m_hWnd, wGS(MSG_SUPPORT_COMPLETE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK);
MessageBox(wGS(MSG_SUPPORT_COMPLETE).c_str(), wGS(MSG_SUPPORT_PROJECT64).c_str(), MB_OK);
EndDialog(wID);
return TRUE;
}

View File

@ -50,10 +50,10 @@ void CSupportWindow::EnableContinue()
LRESULT CSupportWindow::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
SetWindowTextW(m_hWnd, wGS(MSG_SUPPORT_TITLE).c_str());
SetWindowTextW(GetDlgItem(IDC_ENTER_CODE), wGS(MSG_SUPPORT_ENTER_CODE).c_str());
SetWindowTextW(GetDlgItem(ID_SUPPORT_PJ64), wGS(MSG_SUPPORT_PROJECT64).c_str());
SetWindowTextW(GetDlgItem(IDCANCEL), wGS(MSG_SUPPORT_CONTINUE).c_str());
::SetWindowTextW(m_hWnd, wGS(MSG_SUPPORT_TITLE).c_str());
::SetWindowTextW(GetDlgItem(IDC_ENTER_CODE), wGS(MSG_SUPPORT_ENTER_CODE).c_str());
::SetWindowTextW(GetDlgItem(ID_SUPPORT_PJ64), wGS(MSG_SUPPORT_PROJECT64).c_str());
::SetWindowTextW(GetDlgItem(IDCANCEL), wGS(MSG_SUPPORT_CONTINUE).c_str());
{
HWND hInfo = GetDlgItem(IDC_INFO);
@ -73,7 +73,7 @@ LRESULT CSupportWindow::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
{
::SetWindowPos(hInfo,NULL,0,0,rcWin.right, rcWin.bottom,SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOOWNERZORDER);
}
SetWindowTextW(hInfo, InfoText.c_str());
::SetWindowTextW(hInfo, InfoText.c_str());
::GetWindowRect(hInfo,&rcWin);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rcWin, 2);
@ -128,7 +128,7 @@ LRESULT CSupportWindow::OnTimer(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/,
EnableContinue();
}
stdstr_f continue_txt(m_TimeOutTime > 0 ? "%s (%d)" : "%s", GS(MSG_SUPPORT_CONTINUE), m_TimeOutTime);
SetWindowTextW(GetDlgItem(IDCANCEL), continue_txt.ToUTF16().c_str());
::SetWindowTextW(GetDlgItem(IDCANCEL), continue_txt.ToUTF16().c_str());
return true;
}
@ -140,8 +140,8 @@ LRESULT CSupportWindow::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCt
LRESULT CSupportWindow::OnSupportProject64(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
std::string SupportURL = stdstr_f("http://www.pj64-emu.com/support-project64.html?ver=%s", VER_FILE_VERSION_STR);
ShellExecute(NULL, "open", SupportURL.c_str(), NULL, NULL, SW_SHOWMAXIMIZED);
stdstr SupportURL = stdstr_f("http://www.pj64-emu.com/support-project64.html?ver=%s", VER_FILE_VERSION_STR);
ShellExecute(NULL, L"open", SupportURL.ToUTF16().c_str(), NULL, NULL, SW_SHOWMAXIMIZED);
return TRUE;
}

View File

@ -37,7 +37,7 @@ protected:
CContainedWindowT< CEdit > m_wndEditCtrl;
public:
BOOL Create( HWND hWndParent, int nItem, int nSubItem, CRect& rcRect, UINT nFlags, LPCTSTR lpszItemText, CListArray < stdstr >& aComboList )
BOOL Create( HWND hWndParent, int nItem, int nSubItem, CRect& rcRect, UINT nFlags, LPCTSTR lpszItemText, CListArray < std::wstring >& aComboList )
{
m_nItem = nItem;
m_nSubItem = nSubItem;
@ -127,10 +127,10 @@ public:
if ( !( m_nFlags & ( ITEM_FLAGS_EDIT_NUMBER | ITEM_FLAGS_EDIT_FLOAT ) ) || nChar == VK_BACK )
return TRUE;
stdstr strValue;
std::wstring strValue;
int nValueLength = GetWindowTextLength() + 1;
strValue.reserve(nValueLength);
GetWindowText( (char *)strValue.c_str(), nValueLength );
GetWindowText( (wchar_t *)strValue.c_str(), nValueLength );
// get selected positions
DWORD dwSelection = GetEditSel();
@ -143,15 +143,15 @@ public:
BOOL bNegative = FALSE;
if ( m_nFlags & ITEM_FLAGS_EDIT_FLOAT )
{
double dblValue = atof( strValue.c_str() );
double dblValue = _wtof( strValue.c_str() );
bNegative = ( dblValue < 0 );
strValue.Format( _T( "%lf" ), -dblValue );
strValue = stdstr_f("%lf", -dblValue).ToUTF16();
}
else
{
long lValue = _ttol( strValue.c_str() );
long lValue = _wtol( strValue.c_str() );
bNegative = ( lValue < 0 );
strValue.Format( _T( "%ld" ), -lValue );
strValue = stdstr_f("%ld", -lValue).ToUTF16();
}
SetWindowText( strValue.c_str() );
@ -162,7 +162,7 @@ public:
}
// construct new value string using entered character
stdstr strNewValue = strValue.substr(0, nStartChar ) + nChar + strValue.substr(nEndChar, strValue.length() - nEndChar );
std::wstring strNewValue = strValue.substr(0, nStartChar ) + nChar + strValue.substr(nEndChar, strValue.length() - nEndChar );
int nGreaterThan = 0;
int nLessThan = 0;
@ -333,7 +333,7 @@ public:
int nIndex = GetCurSel();
if ( nIndex != CB_ERR )
{
stdstr strText;
std::wstring strText;
int cchLen = GetLBTextLen(nIndex);
if(cchLen != CB_ERR)
{
@ -366,7 +366,7 @@ public:
CWindow wndParent( GetParent() );
if ( wndParent.IsWindow() )
{
stdstr strValue;
std::wstring strValue;
if ( ( GetStyle() & CBS_DROPDOWNLIST ) == CBS_DROPDOWNLIST )
{
@ -381,7 +381,7 @@ public:
}
else
{
strValue = "";
strValue = L"";
}
}
}

View File

@ -76,7 +76,7 @@ public:
else if ( nFlags & ITEM_FLAGS_TIME_ONLY )
SetFormat( szTimeFormat );
else
SetFormat( stdstr_f("%s %s",szDateFormat,szTimeFormat ).c_str() );
SetFormat(stdstr_f("%s %s",szDateFormat,szTimeFormat ).ToUTF16().c_str());
// get current date if setting time-only
if ( nFlags & ITEM_FLAGS_TIME_ONLY )

View File

@ -22,7 +22,7 @@ protected:
int m_nItem;
int m_nSubItem;
UINT m_nFlags;
UINT m_nMaxLen;
int m_nMaxLen;
TCHAR m_nExitChar;
CFont m_fntEditFont;
@ -80,12 +80,14 @@ public:
if ( !( m_nFlags & ( ITEM_FLAGS_EDIT_HEX | ITEM_FLAGS_EDIT_NUMBER | ITEM_FLAGS_EDIT_FLOAT ) ) || nChar == VK_BACK )
return TRUE;
stdstr strValue;
UINT nValueLength = GetWindowTextLength();
strValue.reserve(nValueLength + 1);
strValue.resize(nValueLength);
GetWindowText( (LPTSTR)strValue.c_str(), nValueLength + 1);
std::wstring WindowText;
int nValueLength = GetWindowTextLengthW();
if (nValueLength > 0)
{
WindowText.reserve(nValueLength + 1);
WindowText.resize(nValueLength);
GetWindowTextW((wchar_t *)WindowText.c_str(), nValueLength + 1);
}
// get selected positions
int nStartChar;
int nEndChar;
@ -104,18 +106,18 @@ public:
BOOL bNegative = FALSE;
if ( m_nFlags & ITEM_FLAGS_EDIT_FLOAT )
{
double dblValue = atof( strValue.c_str() );
double dblValue = _wtof(WindowText.c_str());
bNegative = ( dblValue < 0 );
strValue.Format( _T( "%lf" ), -dblValue );
WindowText = stdstr_f("%lf", -dblValue).ToUTF16();
}
else
{
long lValue = _ttol( strValue.c_str() );
long lValue = _wtol(WindowText.c_str() );
bNegative = ( lValue < 0 );
strValue.Format( _T( "%ld" ), -lValue );
WindowText = stdstr_f("%ld", -lValue).ToUTF16();
}
SetWindowText( strValue.c_str() );
SetWindowText(WindowText.c_str());
// restore select position
SetSel( bNegative ? nStartChar - 1 : nStartChar + 1, bNegative ? nEndChar - 1 : nEndChar + 1 );
@ -123,7 +125,7 @@ public:
}
// construct new value string using entered character
stdstr strNewValue = strValue.substr(0, nStartChar ) + nChar + strValue.substr( strValue.length() - nEndChar );
std::wstring strNewValue = WindowText.substr(0, nStartChar ) + nChar + WindowText.substr(WindowText.length() - nEndChar );
int nGreaterThan = 0;
int nLessThan = 0;
@ -216,7 +218,7 @@ public:
CWindow wndParent( GetParent() );
if ( wndParent.IsWindow() )
{
stdstr strValue;
std::wstring strValue;
int nValueLength = GetWindowTextLength();
strValue.reserve(nValueLength + 1);
strValue.resize(nValueLength);

View File

@ -60,13 +60,14 @@ public:
BOOL Show( CRect& rcRect, LPCTSTR lpszItemText, LPCTSTR lpszToolTip )
{
stdstr strItemText = lpszItemText;
stdstr strItemText;
strItemText.FromUTF16(lpszItemText);
if ( !IsWindow() || strItemText.empty() )
return FALSE;
m_strToolTip = lpszToolTip;
SetWindowText( strItemText.c_str() );
m_strToolTip.FromUTF16(lpszToolTip);
SetWindowText(strItemText.ToUTF16().c_str() );
CClientDC dcClient( m_hWnd );
@ -75,7 +76,7 @@ public:
CRect rcTextExtent( rcRect );
// calculate item text extent...
dcClient.DrawText( strItemText.c_str(), (int)strItemText.length(), rcTextExtent, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_CALCRECT );
dcClient.DrawTextW( strItemText.ToUTF16().c_str(), (int)strItemText.length(), rcTextExtent, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER | DT_CALCRECT );
dcClient.SelectFont( hOldFont );
@ -216,7 +217,7 @@ public:
CRect rcItemText( rcClient );
rcItemText.OffsetRect( 4, 0 );
dcPaint.DrawText( strItemText.c_str(), (int)strItemText.length(), rcItemText, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER );
dcPaint.DrawTextW( strItemText.ToUTF16().c_str(), (int)strItemText.length(), rcItemText, DT_LEFT | DT_SINGLELINE | DT_NOPREFIX | DT_VCENTER );
dcPaint.RestoreDC( nContextState );
}

View File

@ -25,13 +25,13 @@ bool CEditNumber32::IsHexConvertableText(LPTSTR _text)
int start, end;
GetSel(start, end);
char WindowText[200];
GetWindowText(WindowText, sizeof(WindowText));
wchar_t WindowText[200];
GetWindowText(WindowText, sizeof(WindowText) / sizeof(WindowText[0]));
bool bPaste = true;
size_t Len = strlen(WindowText);
char head = Len > 0 ? WindowText[0] : 0;
char second = Len > 1 ? WindowText[1] : 0;
size_t Len = wcslen(WindowText);
wchar_t head = Len > 0 ? WindowText[0] : 0;
wchar_t second = Len > 1 ? WindowText[1] : 0;
if (second == 'X' || second == 'x')
{
@ -43,11 +43,11 @@ bool CEditNumber32::IsHexConvertableText(LPTSTR _text)
if (!bPaste) { return bPaste; }
//Check
unsigned int i = 0;
if (strlen(_text) >= 2)
if (wcslen(_text) >= 2)
{
if (_text[0] == '0' && (_text[1] == 'x' || _text[1] == 'X'))
if (_text[0] == L'0' && (_text[1] == L'x' || _text[1] == L'X'))
{
if ((second == 'x' || second == 'X') && (!(start == 0 && end >= 2)))
if ((second == L'x' || second == L'X') && (!(start == 0 && end >= 2)))
{
bPaste = false;
}
@ -62,29 +62,29 @@ bool CEditNumber32::IsHexConvertableText(LPTSTR _text)
}
}
if (!bPaste) return bPaste;
if (strlen(_text) >= 1)
if (wcslen(_text) >= 1)
{
if (head == '0' && (_text[0] == 'x' || _text[0] == 'X'))
if (head == L'0' && (_text[0] == L'x' || _text[0] == L'X'))
{
i++;
}
if ((_text[0] == 'x' || _text[0] == 'X'))
if ((_text[0] == L'x' || _text[0] == L'X'))
{
if (head != '0'&&start == 0)
if (head != L'0' && start == 0)
{
bPaste = false;
}
else if (!(start == 1 && end >= 1 && head == '0'))
else if (!(start == 1 && end >= 1 && head == L'0'))
{
bPaste = false;
}
}
}
if (!bPaste) return bPaste;
for (; i < strlen(_text); i++)
for (; i < wcslen(_text); i++)
{
char c = _text[i];
if (!(c >= 48 && c <= 57 || c >= 'A'&&c <= 'F' || c >= 'a'&&c <= 'f' || c == ' '))
wchar_t c = _text[i];
if (!(c >= 48 && c <= 57 || c >= L'A'&&c <= L'F' || c >= L'a'&&c <= L'f' || c == L' '))
{
bPaste = false;
break;
@ -105,29 +105,29 @@ void CEditNumber32::FormatClipboard()
if (hglb != NULL)
{
lptstr = (LPTSTR)GlobalLock(hglb);
for (unsigned int i = 0; i < strlen(lptstr); i++)
for (unsigned int i = 0; i < wcslen(lptstr); i++)
{
if (lptstr[i] != 'X'&&lptstr[i] != 'x')
if (lptstr[i] != L'X'&&lptstr[i] != L'x')
{
lptstr[i] = (char)toupper(lptstr[i]);
}
if (lptstr[i] == 'X')
if (lptstr[i] == L'X')
{
lptstr[i] = 'x';
lptstr[i] = L'x';
}
if (lptstr[i] == ' ' && (i < strlen(lptstr)))
if (lptstr[i] == ' ' && (i < wcslen(lptstr)))
{
strcpy(&lptstr[i], &lptstr[i + 1]);
wcscpy(&lptstr[i], &lptstr[i + 1]);
}
}
hglb = GlobalAlloc(GMEM_MOVEABLE, (strlen(lptstr) + 1) * sizeof(TCHAR));
hglb = GlobalAlloc(GMEM_MOVEABLE, (wcslen(lptstr) + 1) * sizeof(TCHAR));
if (hglb == NULL)
{
CloseClipboard();
return;
}
lptstrCopy = (LPTSTR)GlobalLock(hglb);
memcpy(lptstrCopy, lptstr, strlen(lptstr) + 1);
memcpy(lptstrCopy, lptstr, wcslen(lptstr) + 1);
GlobalUnlock(lptstr);
GlobalUnlock(hglb);
SetClipboardData(CF_TEXT, hglb);
@ -180,13 +180,12 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
{
int start, end;
GetSel(start, end);
//CString text;
char WindowText[200];
wchar_t WindowText[200];
GetWindowText(WindowText, sizeof(WindowText));
size_t Len = strlen(WindowText);
size_t Len = wcslen(WindowText);
char head = Len > 0 ? WindowText[0] : 0;
char second = Len > 1 ? WindowText[1] : 0;
wchar_t head = Len > 0 ? WindowText[0] : 0;
wchar_t second = Len > 1 ? WindowText[1] : 0;
if (uMsg == WM_CHAR)
{
@ -195,15 +194,15 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
if (m_DisplayType == DisplayHex)
{
MaxLen = 8;
if (second == 'x' || second == 'X')
if (second == L'x' || second == L'X')
{
MaxLen += 2;
}
}
int c = (int)wParam;
wchar_t c = (wchar_t)wParam;
if (wParam < 32)
{
if (wParam == 8 && (second == 'x' || second == 'X') && head == '0' && end == 1)
if (wParam == 8 && (second == L'x' || second == L'X') && head == L'0' && end == 1)
{
//does not allow to delete '0' before x
bHandled = true;
@ -214,7 +213,7 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
return TRUE;
}
if (second == 'x' || second == 'X')
if (second == L'x' || second == L'X')
{
//does not allow to change head except select includes first and second
if (start <= 1 && end <= 1)
@ -223,11 +222,11 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
return TRUE;
}
}
if (start == 1 && (c == 'X' || c == 'x') && head == '0')
if (start == 1 && (c == L'X' || c == L'x') && head == L'0')
{
if (c == 'X')
if (c == L'X')
{
SendMessage(uMsg, 'x', lParam);
SendMessage(uMsg, L'x', lParam);
bHandled = true;
}
else {
@ -235,7 +234,7 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
}
return true;
}
else if (c >= '0' && c <= '9' || c >= 'A' && c <= 'F')
else if (c >= L'0' && c <= L'9' || c >= L'A' && c <= L'F')
{
if (Len >= MaxLen && start == end)
{
@ -245,7 +244,7 @@ LRESULT CEditNumber32::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled = false;
return true;
}
else if (c >= 'a' && c <= 'f')
else if (c >= L'a' && c <= L'f')
{
if (Len >= MaxLen && start == end)
{
@ -283,16 +282,16 @@ void CEditNumber32::SetDisplayType(DisplayType Type)
uint32_t CEditNumber32::GetValue(void)
{
char text[200];
wchar_t text[200];
GetWindowText(text, sizeof(text));
if (m_DisplayType == DisplayDec)
{
return atoi(text);
return _wtoi(text);
}
size_t Finish = strlen(text);
char second = Finish > 1 ? text[1] : 0;
size_t Start = (second == 'x' || second == 'X') ? 2 : 0;
size_t Finish = wcslen(text);
wchar_t second = Finish > 1 ? text[1] : 0;
size_t Start = (second == L'x' || second == L'X') ? 2 : 0;
if (Finish > 8 + Start) { Finish = 8 + Start; }
@ -302,28 +301,28 @@ uint32_t CEditNumber32::GetValue(void)
Value = (Value << 4);
switch (text[i])
{
case '0': break;
case '1': Value += 1; break;
case '2': Value += 2; break;
case '3': Value += 3; break;
case '4': Value += 4; break;
case '5': Value += 5; break;
case '6': Value += 6; break;
case '7': Value += 7; break;
case '8': Value += 8; break;
case '9': Value += 9; break;
case 'A': Value += 10; break;
case 'a': Value += 10; break;
case 'B': Value += 11; break;
case 'b': Value += 11; break;
case 'C': Value += 12; break;
case 'c': Value += 12; break;
case 'D': Value += 13; break;
case 'd': Value += 13; break;
case 'E': Value += 14; break;
case 'e': Value += 14; break;
case 'F': Value += 15; break;
case 'f': Value += 15; break;
case L'0': break;
case L'1': Value += 1; break;
case L'2': Value += 2; break;
case L'3': Value += 3; break;
case L'4': Value += 4; break;
case L'5': Value += 5; break;
case L'6': Value += 6; break;
case L'7': Value += 7; break;
case L'8': Value += 8; break;
case L'9': Value += 9; break;
case L'A': Value += 10; break;
case L'a': Value += 10; break;
case L'B': Value += 11; break;
case L'b': Value += 11; break;
case L'C': Value += 12; break;
case L'c': Value += 12; break;
case L'D': Value += 13; break;
case L'd': Value += 13; break;
case L'E': Value += 14; break;
case L'e': Value += 14; break;
case L'F': Value += 15; break;
case L'f': Value += 15; break;
default:
Value = (Value >> 4);
i = Finish;
@ -339,19 +338,14 @@ stdstr CEditNumber32::GetValueText(void)
void CEditNumber32::SetValue(uint32_t Value, DisplayMode Display)
{
char text[200];
stdstr text;
if (m_DisplayType == DisplayDec)
{
sprintf(text, "%d", Value);
text.Format("%d", Value);
}
else
{
sprintf(
text,
"%s%0*X",
(Display & DisplayMode::ShowHexIdent) == DisplayMode::ShowHexIdent ? "0x" : "",
(Display & DisplayMode::ZeroExtend) == DisplayMode::ZeroExtend ? 8 : 0,
Value);
text.Format("%s%0*X",(Display & DisplayMode::ShowHexIdent) == DisplayMode::ShowHexIdent ? "0x" : "", (Display & DisplayMode::ZeroExtend) == DisplayMode::ZeroExtend ? 8 : 0, Value);
}
SetWindowText(text);
SetWindowText(text.ToUTF16().c_str());
}

View File

@ -5,12 +5,13 @@
inline static stdstr GetCWindowText(const CWindow *window)
{
stdstr Result;
int nLen = ::GetWindowTextLength(window->m_hWnd);
int nLen = ::GetWindowTextLengthW(window->m_hWnd);
if (nLen == 0)
{
return Result;
}
Result.resize(nLen + 1);
::GetWindowText(window->m_hWnd, (char *)Result.c_str(), nLen + 1);
return Result;
std::wstring WindowText;
WindowText.resize(nLen + 1);
::GetWindowTextW(window->m_hWnd, (wchar_t *)WindowText.c_str(), nLen + 1);
return Result.FromUTF16(WindowText.c_str());
}

View File

@ -54,10 +54,10 @@ CHexEditCtrl::~CHexEditCtrl(void)
{
}
int CALLBACK CHexEditCtrl::HaveFontCb(CONST LOGFONTA* lplf, CONST TEXTMETRICA* /*lptm*/, DWORD /*FontType*/, LPARAM lParam)
int CALLBACK CHexEditCtrl::HaveFontCb(CONST LOGFONTW* lplf, CONST TEXTMETRICW* /*lptm*/, DWORD /*FontType*/, LPARAM lParam)
{
const char* name = (const char*)lParam;
if (strcmp(lplf->lfFaceName, name) == 0)
const wchar_t * name = (const wchar_t*)lParam;
if (wcscmp(lplf->lfFaceName, name) == 0)
{
return 0;
}
@ -66,7 +66,7 @@ int CALLBACK CHexEditCtrl::HaveFontCb(CONST LOGFONTA* lplf, CONST TEXTMETRICA* /
bool CHexEditCtrl::HaveFont(HDC hdc, const char* name)
{
if (EnumFonts(hdc, name, HaveFontCb, (LPARAM)name) == 0)
if (EnumFonts(hdc, stdstr(name).ToUTF16().c_str(), HaveFontCb, (LPARAM)stdstr(name).ToUTF16().c_str()) == 0)
{
return true;
}
@ -117,7 +117,7 @@ BOOL CHexEditCtrl::Attach(HWND hWnd)
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
FF_DONTCARE | FIXED_PITCH,
"Consolas");
L"Consolas");
}
else
{
@ -508,15 +508,16 @@ bool CHexEditCtrl::UpdateCaretUI(bool bEnsureVisible, bool bTop)
void CHexEditCtrl::Text(int x, int y, const char *text, COLORREF bg, COLORREF fg, CRect *rcOut)
{
size_t length = strlen(text);
std::wstring textOuput = stdstr(text).ToUTF16();
size_t length = textOuput.length();
int calcWidth = length * m_CharWidth;
CRect rc(x, y, 0, 0);
COLORREF orgBg = ::SetBkColor(m_BackDC, bg);
COLORREF orgFg = ::SetTextColor(m_BackDC, fg);
::DrawText(m_BackDC, text, -1, &rc, DT_TOP | DT_NOPREFIX | DT_CALCRECT);
::DrawText(m_BackDC, textOuput.c_str(), -1, &rc, DT_TOP | DT_NOPREFIX | DT_CALCRECT);
rc.right = rc.left + calcWidth; // just in case
::DrawText(m_BackDC, text, -1, &rc, DT_TOP | DT_NOPREFIX);
::DrawText(m_BackDC, textOuput.c_str(), -1, &rc, DT_TOP | DT_NOPREFIX);
InvalidateRect(&rc, false);
::SetBkColor(m_BackDC, orgBg);
::SetBkColor(m_BackDC, orgFg);

View File

@ -131,7 +131,7 @@ public:
static char ByteAscii(uint8_t value);
static uint8_t HexCharValue(char c);
static int CALLBACK HaveFontCb(CONST LOGFONTA *lplf, CONST TEXTMETRICA *lptm, DWORD FontType, LPARAM lParam);
static int CALLBACK HaveFontCb(CONST LOGFONTW *lplf, CONST TEXTMETRICW *lptm, DWORD FontType, LPARAM lParam);
static bool HaveFont(HDC hdc, const char* name);
void Draw(void);

View File

@ -46,7 +46,7 @@ public:
}
}
int AddItem (LPCSTR strItem, const TParam & lParam)
int AddItem (LPCTSTR strItem, const TParam & lParam)
{
int indx = AddString(strItem);
TParam * Value = new TParam(lParam);
@ -59,19 +59,6 @@ public:
return indx;
}
int AddItemW (LPCWSTR strItem, const TParam & lParam)
{
int indx = AddStringW(strItem);
TParam * Value = new TParam(lParam);
SetItemData(indx,(DWORD_PTR)(Value));
m_ParamList.push_back(Value);
if ((m_AllwaysSelected && GetCount() == 1) || m_defaultValue == lParam)
{
SetCurSel(indx);
}
return indx;
}
void SetReset ( bool Reset )
{
m_Reset = Reset;

View File

@ -65,7 +65,7 @@ void CPartialGroupBox::OnPaint(HDC /*hDC*/)
dc.SelectBrush(GetSysColorBrush(COLOR_BTNFACE));
wchar_t grptext[500];
GetWindowTextW(m_hWnd, grptext, sizeof(grptext) / sizeof(grptext[0]));
::GetWindowTextW(m_hWnd, grptext, sizeof(grptext) / sizeof(grptext[0]));
CRect fontsizerect(0, 0, 0, 0);
dc.DrawTextW(grptext, -1, fontsizerect, DT_SINGLELINE | DT_LEFT | DT_CALCRECT);

View File

@ -23,12 +23,13 @@ public:
{
T* pT = static_cast<T*>(this);
std::wstring wcText = stdstr(lpszText).ToUTF16();
TOOLINFO toolInfo = { 0 };
toolInfo.cbSize = sizeof(toolInfo);
toolInfo.hwnd = pT->m_hWnd;
toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
toolInfo.uId = (UINT_PTR) ::GetDlgItem(pT->m_hWnd, ctrlId);
toolInfo.lpszText = lpszText;
toolInfo.lpszText = (LPWSTR)wcText.c_str();
SendMessage(m_hWndTooltip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo);
}

View File

@ -99,7 +99,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
catch (...)
{
WriteTrace(TraceUserInterface, TraceError, "Exception caught (File: \"%s\" Line: %d)", __FILE__, __LINE__);
MessageBox(NULL, stdstr_f("Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).c_str(), "Exception", MB_OK);
MessageBox(NULL, stdstr_f("Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).ToUTF16().c_str(), L"Exception", MB_OK);
}
AppCleanup();
CoUninitialize();