Replace some instances of LoadStringA by LoadStringW.

This commit is contained in:
Alexandre Julliard 2008-03-03 20:07:37 +01:00
parent 28d2930074
commit 4fd668d010
3 changed files with 37 additions and 40 deletions

View File

@ -308,15 +308,12 @@ static BOOL PRINTDLG_UpdatePrintDlgA(HWND hDlg,
nToPage = GetDlgItemInt(hDlg, edt2, NULL, FALSE);
if (nFromPage < lppd->nMinPage || nFromPage > lppd->nMaxPage ||
nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage) {
char resourcestr[256];
char resultstr[256];
LoadStringA(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE,
resourcestr, 255);
sprintf(resultstr,resourcestr, lppd->nMinPage, lppd->nMaxPage);
LoadStringA(COMDLG32_hInstance, PD32_PRINT_TITLE,
resourcestr, 255);
MessageBoxA(hDlg, resultstr, resourcestr,
MB_OK | MB_ICONWARNING);
WCHAR resourcestr[256];
WCHAR resultstr[256];
LoadStringW(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE, resourcestr, 255);
wsprintfW(resultstr,resourcestr, lppd->nMinPage, lppd->nMaxPage);
LoadStringW(COMDLG32_hInstance, PD32_PRINT_TITLE, resourcestr, 255);
MessageBoxW(hDlg, resultstr, resourcestr, MB_OK | MB_ICONWARNING);
return FALSE;
}
lppd->nFromPage = nFromPage;
@ -3569,9 +3566,9 @@ BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA setupdlg) {
bRet = PrintDlgA(&pdlg);
if (!bRet){
if (!(setupdlg->Flags & PSD_NOWARNING)) {
char errstr[256];
LoadStringA(COMDLG32_hInstance, PD32_NO_DEFAULT_PRINTER, errstr, 255);
MessageBoxA(setupdlg->hwndOwner, errstr, 0, MB_OK | MB_ICONERROR);
WCHAR errstr[256];
LoadStringW(COMDLG32_hInstance, PD32_NO_DEFAULT_PRINTER, errstr, 255);
MessageBoxW(setupdlg->hwndOwner, errstr, 0, MB_OK | MB_ICONERROR);
}
return FALSE;
}

View File

@ -305,7 +305,7 @@ static void UIINSERTOBJECTDLG_SelectCreateNew(InsertObjectDlgInfo* pdlgInfo)
*/
static void UIINSERTOBJECTDLG_SelectCreateFromFile(InsertObjectDlgInfo* pdlgInfo)
{
char resstr[MAX_PATH];
WCHAR resstr[MAX_PATH];
ShowWindow(pdlgInfo->hwndAddCtrlBTN, SW_HIDE);
ShowWindow(pdlgInfo->hwndObjTypeLBL, SW_HIDE);
@ -318,10 +318,10 @@ static void UIINSERTOBJECTDLG_SelectCreateFromFile(InsertObjectDlgInfo* pdlgInfo
ShowWindow(pdlgInfo->hwndFileTB, SW_SHOW);
ShowWindow(pdlgInfo->hwndBrowseBTN, SW_SHOW);
SendMessageA(pdlgInfo->hwndCreateFromFileCB, BM_SETCHECK, BST_CHECKED, 0);
SendMessageW(pdlgInfo->hwndCreateFromFileCB, BM_SETCHECK, BST_CHECKED, 0);
if (LoadStringA(OLEDLG_hInstance, IDS_RESULTFILEOBJDESC, resstr, MAX_PATH))
SendMessageA(pdlgInfo->hwndResultDesc, WM_SETTEXT, 0, (LPARAM)resstr);
if (LoadStringW(OLEDLG_hInstance, IDS_RESULTFILEOBJDESC, resstr, MAX_PATH))
SendMessageW(pdlgInfo->hwndResultDesc, WM_SETTEXT, 0, (LPARAM)resstr);
}
@ -418,20 +418,20 @@ static void UIINSERTOBJECTDLG_FreeObjectTypes(InsertObjectDlgInfo* pdlgInfo)
static void UIINSERTOBJECTDLG_SelChange(InsertObjectDlgInfo* pdlgInfo)
{
INT index;
CHAR objname[MAX_PATH];
CHAR objdesc[MAX_PATH];
CHAR resstr[MAX_PATH];
WCHAR objname[MAX_PATH];
WCHAR objdesc[MAX_PATH];
WCHAR resstr[MAX_PATH];
TRACE("\n");
if (LoadStringA(OLEDLG_hInstance, IDS_RESULTOBJDESC, resstr, MAX_PATH) &&
((index = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETCURSEL, 0, 0)) >= 0) &&
SendMessageA(pdlgInfo->hwndObjTypeLB, LB_GETTEXT, (WPARAM)index, (LPARAM)objname))
sprintf(objdesc, resstr, objname);
if (LoadStringW(OLEDLG_hInstance, IDS_RESULTOBJDESC, resstr, MAX_PATH) &&
((index = SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETCURSEL, 0, 0)) >= 0) &&
SendMessageW(pdlgInfo->hwndObjTypeLB, LB_GETTEXT, (WPARAM)index, (LPARAM)objname))
wsprintfW(objdesc, resstr, objname);
else
objdesc[0] = 0;
SendMessageA(pdlgInfo->hwndResultDesc, WM_SETTEXT, 0, (LPARAM)objdesc);
SendMessageW(pdlgInfo->hwndResultDesc, WM_SETTEXT, 0, (LPARAM)objdesc);
}
@ -615,13 +615,13 @@ static void UIINSERTOBJECTDLG_AddControl(InsertObjectDlgInfo* pdlgInfo)
if (!bValid)
{
char title[32];
char msg[256];
WCHAR title[32];
WCHAR msg[256];
LoadStringA(OLEDLG_hInstance, IDS_NOTOLEMODCAPTION, title, 32);
LoadStringA(OLEDLG_hInstance, IDS_NOTOLEMOD, msg, 256);
LoadStringW(OLEDLG_hInstance, IDS_NOTOLEMODCAPTION, title, 32);
LoadStringW(OLEDLG_hInstance, IDS_NOTOLEMOD, msg, 256);
MessageBoxA(pdlgInfo->hwndSelf, msg, title, MB_ICONEXCLAMATION);
MessageBoxW(pdlgInfo->hwndSelf, msg, title, MB_ICONEXCLAMATION);
}
}
}

View File

@ -608,14 +608,13 @@ BOOL DoScannerUI(void)
static void UpdateRelevantEdit(HWND hwnd, const SANE_Option_Descriptor *opt,
int index, int position)
{
CHAR buffer[244];
WCHAR buffer[244];
HWND edit_w;
CHAR unit[20];
LoadStringA(SANE_instance, opt->unit, unit,20);
int len;
if (opt->type == SANE_TYPE_INT)
{
static const WCHAR formatW[] = {'%','i',0};
INT si;
if (opt->constraint.range->quant)
@ -623,11 +622,11 @@ static void UpdateRelevantEdit(HWND hwnd, const SANE_Option_Descriptor *opt,
else
si = position;
sprintf(buffer,"%i %s",si,unit);
len = wsprintfW( buffer, formatW, si );
}
else if (opt->type == SANE_TYPE_FIXED)
{
static const WCHAR formatW[] = {'%','f',0};
double s_quant, dd;
s_quant = SANE_UNFIX(opt->constraint.range->quant);
@ -637,14 +636,15 @@ static void UpdateRelevantEdit(HWND hwnd, const SANE_Option_Descriptor *opt,
else
dd = position * 0.01;
sprintf(buffer,"%f %s",dd,unit);
len = wsprintfW( buffer, formatW, dd );
}
else
buffer[0] = 0;
else return;
buffer[len++] = ' ';
LoadStringW( SANE_instance, opt->unit, buffer + len, sizeof(buffer)/sizeof(WCHAR) - len );
edit_w = GetDlgItem(hwnd,index+ID_BASE+ID_EDIT_BASE);
if (edit_w && buffer[0])
SetWindowTextA(edit_w,buffer);
if (edit_w) SetWindowTextW(edit_w,buffer);
}