From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YahooGroups/src/hooked_events.cpp | 4 ++-- plugins/YahooGroups/src/utils.cpp | 26 +++++++++++++------------- plugins/YahooGroups/src/utils.h | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/YahooGroups/src') diff --git a/plugins/YahooGroups/src/hooked_events.cpp b/plugins/YahooGroups/src/hooked_events.cpp index 19efd4ffda..774537e696 100644 --- a/plugins/YahooGroups/src/hooked_events.cpp +++ b/plugins/YahooGroups/src/hooked_events.cpp @@ -55,8 +55,8 @@ int OnOptionsInitialise(WPARAM wParam, LPARAM) odp.position = 100000000; odp.hInstance = hInstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); - odp.ptszTitle = LPGENT("Yahoo Groups"); - odp.ptszGroup = LPGENT("Plugins"); + odp.pwszTitle = LPGENW("Yahoo Groups"); + odp.pwszGroup = LPGENW("Plugins"); odp.groupPosition = 810000000; odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; odp.pfnDlgProc = DlgProcOptions; diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index b33d7d888f..57ac86c10c 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -34,14 +34,14 @@ int Info(char *title, char *format, ...) return MessageBoxA(0, str, title, MB_OK | MB_ICONINFORMATION); } -int MyPUShowMessage(TCHAR *lpzText, BYTE kind) +int MyPUShowMessage(wchar_t *lpzText, BYTE kind) { if (ServiceExists(MS_POPUP_SHOWMESSAGE)) { return PUShowMessageT(lpzText, kind); } else{ - TCHAR *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning"); + wchar_t *title = (kind == SM_NOTIFY) ? TranslateT("Notify") : TranslateT("Warning"); return MessageBox(NULL, lpzText, title, MB_OK | (kind == SM_NOTIFY) ? MB_ICONINFORMATION : MB_ICONEXCLAMATION); } @@ -158,10 +158,10 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count); } -TCHAR* GetContactName(MCONTACT hContact, char *szProto) +wchar_t* GetContactName(MCONTACT hContact, char *szProto) { ptrT id(Contact_GetInfo(CNF_DISPLAYUID, hContact, szProto)); - return (id != NULL) ? _tcsdup(id) : NULL; + return (id != NULL) ? wcsdup(id) : NULL; } void GetContactProtocol(MCONTACT hContact, char *szProto, int size) @@ -169,7 +169,7 @@ void GetContactProtocol(MCONTACT hContact, char *szProto, int size) GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size); } -TCHAR *GetContactID(MCONTACT hContact) +wchar_t *GetContactID(MCONTACT hContact) { char protocol[256]; GetContactProtocol(hContact, protocol, sizeof(protocol)); @@ -177,18 +177,18 @@ TCHAR *GetContactID(MCONTACT hContact) return GetContactID(hContact, protocol); } -TCHAR* GetContactID(MCONTACT hContact, char *szProto) +wchar_t* GetContactID(MCONTACT hContact, char *szProto) { ptrT id(Contact_GetInfo(CNF_DISPLAY, hContact, szProto)); - return (id != NULL) ? _tcsdup(id) : NULL; + return (id != NULL) ? wcsdup(id) : NULL; } -MCONTACT GetContactFromID(TCHAR *szID, char *szProto) +MCONTACT GetContactFromID(wchar_t *szID, char *szProto) { - TCHAR *szHandle; - TCHAR dispName[1024]; + wchar_t *szHandle; + wchar_t dispName[1024]; char cProtocol[256]; - TCHAR *tmp; + wchar_t *tmp; int found = 0; for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { @@ -196,7 +196,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) szHandle = GetContactID(hContact, cProtocol); tmp = pcli->pfnGetContactDisplayName(hContact, 0); - _tcsncpy(dispName, tmp, _countof(dispName)); + wcsncpy(dispName, tmp, _countof(dispName)); if ((szHandle) && ((mir_tstrcmpi(szHandle, szID) == 0) || (mir_tstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0))) found = 1; @@ -212,7 +212,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) #pragma warning (default: 4312) #pragma warning (disable: 4312) -MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto) +MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto) { char protocol[1024]; WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL); diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index 8269e2c61c..fc94116254 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -44,11 +44,11 @@ int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size); int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, int count); -TCHAR *GetContactName(MCONTACT hContact, char *szProto); -TCHAR *GetContactID(MCONTACT hContact); -TCHAR *GetContactID(MCONTACT hContact, char *szProto); -MCONTACT GetContactFromID(TCHAR *szID, char *szProto); -MCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto); +wchar_t *GetContactName(MCONTACT hContact, char *szProto); +wchar_t *GetContactID(MCONTACT hContact); +wchar_t *GetContactID(MCONTACT hContact, char *szProto); +MCONTACT GetContactFromID(wchar_t *szID, char *szProto); +MCONTACT GetContactFromID(wchar_t *szID, wchar_t *szProto); void GetContactProtocol(MCONTACT hContact, char *szProto, int size); int MyPUShowMessage(char *lpzText, BYTE kind); -- cgit v1.2.3