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/AvatarHistory/src/AvatarDlg.cpp | 50 ++++++++++++++--------------- plugins/AvatarHistory/src/AvatarHistory.cpp | 30 ++++++++--------- plugins/AvatarHistory/src/options.cpp | 8 ++--- plugins/AvatarHistory/src/popup.cpp | 14 ++++---- plugins/AvatarHistory/src/popup.h | 12 +++---- plugins/AvatarHistory/src/stdafx.h | 16 ++++----- plugins/AvatarHistory/src/utils.cpp | 40 +++++++++++------------ 7 files changed, 85 insertions(+), 85 deletions(-) (limited to 'plugins/AvatarHistory/src') diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 481fea0fac..623d4a8c0e 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -23,7 +23,7 @@ Avatar History Plugin HGENMENU hMenu = NULL; void __cdecl AvatarDialogThread(void *param); static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); -int ShowSaveDialog(HWND hwnd, TCHAR* fn,MCONTACT hContact = NULL); +int ShowSaveDialog(HWND hwnd, wchar_t* fn,MCONTACT hContact = NULL); bool ProtocolEnabled(const char *proto); int FillAvatarListFromDB(HWND list, MCONTACT hContact); @@ -31,15 +31,15 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact); int FillAvatarListFromFiles(HWND list, MCONTACT hContact); int CleanupAvatarPic(HWND hwnd); bool UpdateAvatarPic(HWND hwnd); -TCHAR * GetContactFolder(TCHAR *fn, MCONTACT hContact); -BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file); +wchar_t * GetContactFolder(wchar_t *fn, MCONTACT hContact); +BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file); static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam); struct AvatarDialogData { MCONTACT hContact; - TCHAR fn[MAX_PATH]; + wchar_t fn[MAX_PATH]; HWND parent; }; @@ -61,8 +61,8 @@ public: } MEVENT hDbEvent; - TCHAR *filename; - TCHAR *filelink; + wchar_t *filename; + wchar_t *filelink; }; int OpenAvatarDialog(MCONTACT hContact, char* fn) @@ -80,7 +80,7 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn) avdlg->hContact = hContact; if (fn == NULL) { - avdlg->fn[0] = _T('\0'); + avdlg->fn[0] = '\0'; } else { @@ -133,9 +133,9 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l else FillAvatarListFromFiles(hwndList, data->hContact); - TCHAR *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0); + wchar_t *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0); if (displayName) { - TCHAR title[MAX_PATH]; + wchar_t title[MAX_PATH]; mir_sntprintf(title, TranslateT("Avatar History for %s"), displayName); SetWindowText(hwnd, title); } @@ -317,7 +317,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l case IDC_OPENFOLDER: if (HIWORD(wParam) == BN_CLICKED && opts.log_per_contact_folders) { - TCHAR avfolder[MAX_PATH]; + wchar_t avfolder[MAX_PATH]; MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA); GetContactFolder(avfolder, hContact); ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, NULL, NULL, SW_SHOWNORMAL); @@ -352,16 +352,16 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l } -int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list) +int AddFileToList(wchar_t *path,wchar_t *lnk,wchar_t *filename, HWND list) { // Add to list ListEntry *le = new ListEntry(); le->filename = mir_tstrdup(path); le->filelink = mir_tstrdup(lnk); - TCHAR *p = _tcschr(filename, _T('.')); + wchar_t *p = wcschr(filename, '.'); if (p != NULL) - p[0] = _T('\0'); + p[0] = '\0'; int max_pos = SendMessage(list, LB_ADDSTRING, 0, (LPARAM)filename); SendMessage(list, LB_SETITEMDATA, max_pos, (LPARAM)le); return max_pos; @@ -370,7 +370,7 @@ int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list) int FillAvatarListFromFiles(HWND list, MCONTACT hContact) { int max_pos = 0; - TCHAR dir[MAX_PATH], path[MAX_PATH]; + wchar_t dir[MAX_PATH], path[MAX_PATH]; WIN32_FIND_DATA finddata; GetContactFolder(dir, hContact); @@ -397,7 +397,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) int FillAvatarListFromFolder(HWND list, MCONTACT hContact) { int max_pos = 0; - TCHAR dir[MAX_PATH], path[MAX_PATH]; + wchar_t dir[MAX_PATH], path[MAX_PATH]; WIN32_FIND_DATA finddata; GetContactFolder(dir, hContact); @@ -411,7 +411,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) { if (finddata.cFileName[0] != '.') { - TCHAR lnk[MAX_PATH]; + wchar_t lnk[MAX_PATH]; mir_sntprintf(lnk, L"%s\\%s", dir, finddata.cFileName); if (ResolveShortcut(lnk, path)) max_pos = AddFileToList(path,lnk,finddata.cFileName,list); @@ -435,11 +435,11 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) if (dbei.eventType != EVENTTYPE_AVATAR_CHANGE) continue; // Get time - TCHAR date[64]; + wchar_t date[64]; TimeZone_ToStringT(dbei.timestamp, L"d s", date, _countof(date)); // Get file in disk - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; ptrT tszStoredPath(mir_utf8decodeT((char*)dbei.pBlob)); PathToAbsoluteT(tszStoredPath, path); @@ -514,7 +514,7 @@ void InitMenuItem() CMenuItem mi; SET_UID(mi,0x2fb5c7eb, 0xa606, 0x4145, 0x9e, 0x86, 0x73, 0x88, 0x73, 0x1d, 0xe7, 0x5c); - mi.name.t = LPGENT("View Avatar History"); + mi.name.w = LPGENW("View Avatar History"); mi.flags = CMIF_TCHAR; mi.position = 1000090010; mi.hIcolibItem = createDefaultOverlayedIcon(FALSE); @@ -530,9 +530,9 @@ static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam) } -int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) +int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) { - TCHAR filter[MAX_PATH], file[MAX_PATH]; + wchar_t filter[MAX_PATH], file[MAX_PATH]; Bitmap_GetFilter(filter, _countof(filter)); OPENFILENAME ofn = { 0 }; @@ -543,11 +543,11 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) ofn.lpstrFilter = filter; ofn.nFilterIndex = 1; - _tcsncpy_s(file, (_tcsrchr(fn, '\\') + 1), _TRUNCATE); + wcsncpy_s(file, (wcsrchr(fn, '\\') + 1), _TRUNCATE); ofn.lpstrFile = file; - TCHAR *displayName = pcli->pfnGetContactDisplayName(hContact, 0); - TCHAR title[MAX_PATH]; + wchar_t *displayName = pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t title[MAX_PATH]; if (displayName) { mir_sntprintf(title, TranslateT("Save Avatar for %s"), displayName); @@ -559,7 +559,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) } ofn.nMaxFile = MAX_PATH; ofn.Flags = OFN_PATHMUSTEXIST | OFN_DONTADDTORECENT; - ofn.lpstrDefExt = _tcsrchr(fn, '.')+1; + ofn.lpstrDefExt = wcsrchr(fn, '.')+1; DBVARIANT dbvInitDir = {0}; if (!db_get_ts(hContact,MODULE_NAME,"SavedAvatarFolder",&dbvInitDir)) diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 3f833d86f0..46547ae455 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -30,16 +30,16 @@ DWORD mirVer; HANDLE hFolder = NULL; -TCHAR profilePath[MAX_PATH]; // database profile path (read at startup only) -TCHAR basedir[MAX_PATH]; +wchar_t profilePath[MAX_PATH]; // database profile path (read at startup only) +wchar_t basedir[MAX_PATH]; int hLangpack = 0; MWindowList hAvatarWindowsList = NULL; int OptInit(WPARAM wParam,LPARAM lParam); -TCHAR* GetHistoryFolder(TCHAR *fn); -TCHAR* GetProtocolFolder(TCHAR *fn, char *proto); -TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact); +wchar_t* GetHistoryFolder(wchar_t *fn); +wchar_t* GetProtocolFolder(wchar_t *fn, char *proto); +wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact); void InitMenuItem(); @@ -75,9 +75,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam) { - TCHAR hash[128]; + wchar_t hash[128]; - _tcsncpy_s(hash, (TCHAR*)lParam, _TRUNCATE); + wcsncpy_s(hash, (wchar_t*)lParam, _TRUNCATE); ConvertToFilename(hash, _countof(hash)); return (INT_PTR)GetCachedAvatar((char*)wParam, hash); } @@ -145,7 +145,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) SkinPlaySound("avatar_changed"); db_set_ts(hContact, "AvatarHistory", "AvatarHash", avatar->hash); - TCHAR history_filename[MAX_PATH] = L""; + wchar_t history_filename[MAX_PATH] = L""; if (ContactEnabled(hContact, "LogToDisk", AVH_DEF_LOGTODISK)) { if (!opts.log_store_as_hash) { @@ -158,7 +158,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) MCONTACT hMetaContact = db_mc_getMeta(hContact); if (hMetaContact && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) { - TCHAR filename[MAX_PATH] = L""; + wchar_t filename[MAX_PATH] = L""; GetOldStyleAvatarName(filename, hMetaContact); if (CopyImageFile(avatar->filename, filename)) @@ -170,12 +170,12 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) } else { // See if we already have the avatar - TCHAR hash[128]; + wchar_t hash[128]; - _tcsncpy_s(hash, avatar->hash, _TRUNCATE); + wcsncpy_s(hash, avatar->hash, _TRUNCATE); ConvertToFilename(hash, _countof(hash)); - TCHAR *file = GetCachedAvatar(proto, hash); + wchar_t *file = GetCachedAvatar(proto, hash); if (file != NULL) { mir_tstrncpy(history_filename, file, _countof(history_filename)); @@ -210,7 +210,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) ShowPopup(hContact, NULL, opts.popup_changed); if (ContactEnabled(hContact, "LogToHistory", AVH_DEF_LOGTOHISTORY)) { - TCHAR rel_path[MAX_PATH]; + wchar_t rel_path[MAX_PATH]; PathToRelativeT(history_filename, rel_path); T2Utf blob(rel_path); @@ -346,8 +346,8 @@ extern "C" __declspec(dllexport) int Load(void) if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0) mir_tstrcpy(profilePath, L"."); // Failed, use current dir - SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar")); - SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar")); + SkinAddNewSoundExT("avatar_changed",LPGENW("Avatar History"),LPGENW("Contact changed avatar")); + SkinAddNewSoundExT("avatar_removed",LPGENW("Avatar History"),LPGENW("Contact removed avatar")); hAvatarWindowsList = WindowList_Create(); diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index 5a30baeacf..976c9174cd 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -148,16 +148,16 @@ int OptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = hInst; - odp.ptszGroup = LPGENT("History"); // group to put your item under - odp.ptszTitle = LPGENT("Avatar"); // name of the item + odp.pwszGroup = LPGENW("History"); // group to put your item under + odp.pwszTitle = LPGENW("Avatar"); // name of the item odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; Options_AddPage(wParam, &odp); if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - odp.ptszGroup = LPGENT("Popups"); - odp.ptszTitle = LPGENT("Avatar Change"); + odp.pwszGroup = LPGENW("Popups"); + odp.pwszTitle = LPGENW("Avatar Change"); odp.pfnDlgProc = PopupsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPS); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index b0ad399afb..2c7bbeef11 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -55,25 +55,25 @@ void DeInitPopups() // Show an error popup -void ShowErrPopup(const TCHAR *description, const TCHAR *title) +void ShowErrPopup(const wchar_t *description, const wchar_t *title) { ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) L" Error" : title, description, NULL, POPUP_TYPE_ERROR, NULL); } -void ShowTestPopup(MCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op) +void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op) { ShowPopupEx(hContact, title, description, NULL, POPUP_TYPE_TEST, op); } -void ShowPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description) +void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description) { ShowPopupEx(hContact, title, description, (void*)hContact, POPUP_TYPE_NORMAL, &opts); } -void ShowDebugPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description) +void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description) { if (db_get_b(NULL,MODULE_NAME,"Debug",0)) { @@ -89,7 +89,7 @@ typedef struct PopupDataType; // Show an popup -void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description, +void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description, void *plugin_data, int type, const Options *op) { if (ServiceExists(MS_POPUP_ADDPOPUPT)) @@ -107,7 +107,7 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description if (title != NULL) mir_tstrncpy(ppd.lptzContactName, title, _countof(ppd.lptzContactName)); else if (hContact != NULL) - mir_tstrncpy(ppd.lptzContactName, (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0), + mir_tstrncpy(ppd.lptzContactName, (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0), _countof(ppd.lptzContactName)); if (description != NULL) @@ -174,7 +174,7 @@ void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description } else { - MessageBox(NULL, description, title ? title : (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0), + MessageBox(NULL, description, title ? title : (wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0), MB_OK); } diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h index edc08e5bcb..bc12bfc544 100644 --- a/plugins/AvatarHistory/src/popup.h +++ b/plugins/AvatarHistory/src/popup.h @@ -29,9 +29,9 @@ struct Options { // Popup BOOL popup_show_changed; - TCHAR popup_changed[1024]; + wchar_t popup_changed[1024]; BOOL popup_show_removed; - TCHAR popup_removed[1024]; + wchar_t popup_removed[1024]; WORD popup_delay_type; WORD popup_timeout; BYTE popup_use_win_colors; @@ -54,16 +54,16 @@ void DeInitPopups(); #define POPUP_TYPE_ERROR 2 // Show an popup -void ShowPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description); -void ShowDebugPopup(MCONTACT hContact, const TCHAR *title, const TCHAR *description); +void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description); +void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description); // Show an test -void ShowTestPopup(MCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op); +void ShowTestPopup(MCONTACT hContact,const wchar_t *title, const wchar_t *description, const Options *op); // Show an error popup void ShowErrPopup(const char *description, const char *title = NULL); -void ShowPopupEx(MCONTACT hContact, const TCHAR *title, const TCHAR *description, +void ShowPopupEx(MCONTACT hContact, const wchar_t *title, const wchar_t *description, void *plugin_data, int type, const Options *op); diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h index 0c1301278b..42752e9625 100644 --- a/plugins/AvatarHistory/src/stdafx.h +++ b/plugins/AvatarHistory/src/stdafx.h @@ -37,7 +37,7 @@ extern DWORD mirVer; extern MWindowList hAvatarWindowsList; extern Options opts; extern HANDLE hFolder; -extern TCHAR basedir[]; +extern wchar_t basedir[]; #define MODULE_NAME "AvatarHistory" @@ -51,8 +51,8 @@ extern TCHAR basedir[]; #define AVH_DEF_DEFPOPUPS 0 #define AVH_DEF_SHOWMENU 1 -#define DEFAULT_TEMPLATE_REMOVED LPGENT("removed his/her avatar") -#define DEFAULT_TEMPLATE_CHANGED LPGENT("changed his/her avatar") +#define DEFAULT_TEMPLATE_REMOVED LPGENW("removed his/her avatar") +#define DEFAULT_TEMPLATE_CHANGED LPGENW("changed his/her avatar") void LoadOptions(); @@ -69,14 +69,14 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn); // utils -TCHAR* GetCachedAvatar(char *proto, TCHAR *hash); +wchar_t* GetCachedAvatar(char *proto, wchar_t *hash); bool ProtocolEnabled(const char *proto); bool ContactEnabled(MCONTACT hContact, char *setting, int def); -BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file); -void ConvertToFilename(TCHAR *str, size_t size); +BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file); +void ConvertToFilename(wchar_t *str, size_t size); -void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename); -BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut); +void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename); +BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut); #define POPUP_ACTION_DONOTHING 0 #define POPUP_ACTION_CLOSEPOPUP 1 diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index c062534c32..07ef4f9e97 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -59,7 +59,7 @@ BOOL IsUnicodeAscii(const WCHAR * pBuffer, int nSize) return TRUE; } -void ConvertToFilename(TCHAR *str, size_t size) +void ConvertToFilename(wchar_t *str, size_t size) { for(size_t i = 0; i < size && str[i] != '\0'; i++) { switch(str[i]) { @@ -77,10 +77,10 @@ void ConvertToFilename(TCHAR *str, size_t size) } } -TCHAR* GetExtension(TCHAR *file) +wchar_t* GetExtension(wchar_t *file) { if (file == NULL) return L""; - TCHAR *ext = _tcsrchr(file, _T('.')); + wchar_t *ext = wcsrchr(file, '.'); if (ext != NULL) ext++; else @@ -89,7 +89,7 @@ TCHAR* GetExtension(TCHAR *file) return ext; } -TCHAR* GetHistoryFolder(TCHAR *fn) +wchar_t* GetHistoryFolder(wchar_t *fn) { if (fn == NULL) return NULL; FoldersGetCustomPathT(hFolder, fn, MAX_PATH, basedir); @@ -97,7 +97,7 @@ TCHAR* GetHistoryFolder(TCHAR *fn) return fn; } -TCHAR* GetProtocolFolder(TCHAR *fn, char *proto) +wchar_t* GetProtocolFolder(wchar_t *fn, char *proto) { GetHistoryFolder(fn); @@ -109,20 +109,20 @@ TCHAR* GetProtocolFolder(TCHAR *fn, char *proto) return fn; } -TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) +wchar_t* GetContactFolder(wchar_t *fn, MCONTACT hContact) { char *proto = GetContactProto(hContact); GetProtocolFolder(fn, proto); - TCHAR uin[MAX_PATH]; + wchar_t uin[MAX_PATH]; ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact, proto)); - _tcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE); + wcsncpy_s(uin, (id == NULL) ? TranslateT("Unknown UIN") : id, _TRUNCATE); ConvertToFilename(uin, MAX_PATH); //added so that weather id's like "yw/CI0000" work mir_sntprintf(fn, MAX_PATH, L"%s\\%s", fn, uin); CreateDirectoryTreeT(fn); #ifdef DBGPOPUPS - TCHAR log[1024]; + wchar_t log[1024]; mir_sntprintf(log, L"Path: %s\nProto: %S\nUIN: %s", fn, proto, uin); ShowPopup(hContact, L"AVH Debug: GetContactFolder", log); #endif @@ -130,7 +130,7 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) return fn; } -TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact) +wchar_t* GetOldStyleAvatarName(wchar_t *fn, MCONTACT hContact) { GetContactFolder(fn, hContact); @@ -144,9 +144,9 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, MCONTACT hContact) return fn; } -void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) +void CreateOldStyleShortcut(MCONTACT hContact, wchar_t *history_filename) { - TCHAR shortcut[MAX_PATH] = L""; + wchar_t shortcut[MAX_PATH] = L""; GetOldStyleAvatarName(shortcut, hContact); @@ -163,18 +163,18 @@ void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) } } -BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file) +BOOL CopyImageFile(wchar_t *old_file, wchar_t *new_file) { - TCHAR *ext = GetExtension(old_file); + wchar_t *ext = GetExtension(old_file); mir_sntprintf(new_file, MAX_PATH, L"%s.%s", new_file, ext); return !CopyFile(old_file, new_file, TRUE); } -TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) +wchar_t * GetCachedAvatar(char *proto, wchar_t *hash) { - TCHAR *ret = NULL; - TCHAR file[1024] = L""; - TCHAR search[1024] = L""; + wchar_t *ret = NULL; + wchar_t file[1024] = L""; + wchar_t search[1024] = L""; if (opts.log_keep_same_folder) GetHistoryFolder(file); else @@ -207,7 +207,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) return ret; } -BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut) +BOOL CreateShortcut(wchar_t *file, wchar_t *shortcut) { IShellLink *psl = NULL; HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **) &psl); @@ -227,7 +227,7 @@ BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut) return SUCCEEDED(hr); } -BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file) +BOOL ResolveShortcut(wchar_t *shortcut, wchar_t *file) { IShellLink* psl = NULL; -- cgit v1.2.3