From 84b5cac8e0f148250c44fc91d7d9752dca13dbb6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 28 May 2015 17:16:36 +0000 Subject: - MS_UTILS_GETBITMAPFILTERSTRINGS - end of story, replaced with BmpFilterGetStrings(); - parasite mir_strncat's removed from bitmap filter creation; - CMString::AllocSysString/SetSysString removed due to complete uselessness; - CMString::Detouch - typo fixed. git-svn-id: http://svn.miranda-ng.org/main/trunk@13881 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_picture.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'protocols/Tlen/src/tlen_picture.cpp') diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index cc7163c13f..adfd6ea1ca 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -258,21 +258,21 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { DBVARIANT dbv; if (!db_get(hContact, proto->m_szModuleName, "jid", &dbv)) { char *jid = dbv.pszVal; - char szFilter[512]; - char *szFileName = (char*) mir_alloc(_MAX_PATH); - OPENFILENAMEA ofn = {0}; - CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, ( WPARAM ) sizeof( szFilter ), ( LPARAM )szFilter ); + + TCHAR tszFilter[512], tszFileName[MAX_PATH]; + BmpFilterGetStrings(tszFilter, SIZEOF(tszFilter)); + tszFileName[0] = '\0'; + + OPENFILENAME ofn = {0}; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; - ofn.hwndOwner = NULL; - ofn.lpstrFilter = szFilter; + ofn.lpstrFilter = tszFilter; ofn.lpstrCustomFilter = NULL; - ofn.lpstrFile = szFileName; + ofn.lpstrFile = tszFileName; ofn.nMaxFile = _MAX_PATH; ofn.Flags = OFN_FILEMUSTEXIST; - szFileName[0] = '\0'; - if ( GetOpenFileNameA( &ofn )) { + if (GetOpenFileName(&ofn)) { long size; - FILE* fp = fopen( szFileName, "rb" ); + FILE* fp = _tfopen(tszFileName, _T("rb")); if (fp) { fseek(fp, 0, SEEK_END); size = ftell(fp); @@ -284,6 +284,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { char idStr[10]; char fileBuffer[2048]; int id = TlenSerialNext(proto); + T2Utf szFileName(tszFileName); mir_snprintf(idStr, SIZEOF(idStr), "%d", id); item = TlenListAdd(proto, LIST_PICTURE, idStr); item->ft = TlenFileCreateFT(proto, jid); -- cgit v1.2.3