From c0fea55f25ad1f675f40815cefb34b435f32119b Mon Sep 17 00:00:00 2001 From: sje Date: Thu, 23 Nov 2006 03:22:51 +0000 Subject: use ansi font services if unicode ones unavailable bugfixes to allow pure ansi build git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@57 4f64403b-2f21-0410-a795-97e2b3489a10 --- yapp/options.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'yapp/options.cpp') diff --git a/yapp/options.cpp b/yapp/options.cpp index 5f3e0d5..ed77921 100644 --- a/yapp/options.cpp +++ b/yapp/options.cpp @@ -3,6 +3,7 @@ #include "resource.h" #include "popwin.h" #include +#include "str_utils.h" Options options; @@ -84,18 +85,18 @@ void SaveOptions() { } void ShowExamplePopups() { - POPUPDATAW pd = {0}; + POPUPDATAT pd = {0}; pd.lchIcon = hPopupIcon; - wcscpy(pd.lpwzContactName, TranslateT("Example")); - wcscpy(pd.lpwzText, TranslateT("The quick brown fox jumped over the lazy dog.")); - CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, 0); - wcscpy(pd.lpwzContactName, TranslateT("Example With a Long Title")); - wcscpy(pd.lpwzText, TranslateT("The quick brown fox jumped over the lazy dog.")); - CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, 0); - wcscpy(pd.lpwzContactName, TranslateT("Example")); - wcscpy(pd.lpwzText, TranslateT("Thequickbrownfoxjumpedoverthelazydog.")); - CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, 0); + _tcscpy(pd.lptzContactName, TranslateT("Example")); + _tcscpy(pd.lptzText, TranslateT("The quick brown fox jumped over the lazy dog.")); + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0); + _tcscpy(pd.lptzContactName, TranslateT("Example With a Long Title")); + _tcscpy(pd.lptzText, TranslateT("The quick brown fox jumped over the lazy dog.")); + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0); + _tcscpy(pd.lptzContactName, TranslateT("Example")); + _tcscpy(pd.lptzText, TranslateT("Thequickbrownfoxjumpedoverthelazydog.")); + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0); HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); while(hContact) { @@ -103,8 +104,8 @@ void ShowExamplePopups() { AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0); if(ace && ace->dwFlags & AVS_BITMAP_VALID) { pd.lchContact = hContact; - wcscpy(pd.lpwzText, TranslateT("An avatar.")); - CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, 0); + _tcscpy(pd.lptzText, TranslateT("An avatar.")); + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0); break; } } @@ -180,14 +181,11 @@ static BOOL CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvI.mask = LVIF_TEXT; char *strptr; - wchar_t buff[256]; + TCHAR buff[256]; int i = 0; for(; i < 10; i++) { strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(ID_STATUS_OFFLINE + i), (LPARAM)0); - int cp = CP_ACP; - if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) - cp = (int)CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); - MultiByteToWideChar(cp, 0, strptr, -1, buff, 256); + a2t(strptr, buff, 256); lvI.pszText = buff; lvI.iItem = i; ListView_InsertItem(hwndList, &lvI); -- cgit v1.2.3