summaryrefslogtreecommitdiff
path: root/protocols/Tlen
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-28 17:16:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-28 17:16:36 +0000
commit84b5cac8e0f148250c44fc91d7d9752dca13dbb6 (patch)
treefbb1f7d612419ea7ff02770ca5e5af31c28ebd61 /protocols/Tlen
parente22f3f791caefb016c7ba72256c325609f6a5a5b (diff)
- 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
Diffstat (limited to 'protocols/Tlen')
-rw-r--r--protocols/Tlen/src/tlen_picture.cpp21
1 files changed, 11 insertions, 10 deletions
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);