diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-12 22:43:02 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-12 22:43:02 +0300 |
commit | e2b98c75887cd08a278c2056ab8742b5108cf0ad (patch) | |
tree | 9c43ec12217b89a13b919a5665c7d626b1ec915b | |
parent | 641a23ca97dea2958849593485fc4022a084eb07 (diff) |
something working ?
-rw-r--r-- | messages.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/messages.cpp b/messages.cpp index 7a16dcd..ed3da04 100644 --- a/messages.cpp +++ b/messages.cpp @@ -64,21 +64,34 @@ int RecvMsgSvc(WPARAM w, LPARAM l) cmd += _T("--output \"");
cmd += tmp2;
cmd += _T("\\decrypted_data\"");
- mir_free(tmp2);
cmd += _T(" -d -a \"");
cmd += path;
cmd += _T("\"");
pxExecute(&cmd, "", &out, &code);
DeleteFile(path.c_str());
- cp866_to_cp1251(&out);
+ str.clear();
{
- string::size_type p = out.find(">\"") +2;
- TCHAR *tmp = mir_a2t (out.substr(p).c_str());
- if(_tcslen(tmp) > 0)
+ wstring path = tmp2;
+ mir_free(tmp2);
+ path += _T("\\decrypted_data");
+ fstream f(path.c_str(), std::ios::in);
+ while(!f.eof())
{
- mir_free((void**)ccs->lParam);
- char *utf = mir_utf8encodeW(tmp);
- ccs->lParam = (LPARAM)utf;
+ char tmp[256];
+ f.getline(tmp, 256);
+ TCHAR *tmp2 = mir_a2t(tmp);
+ str.append(tmp2).append(_T("\n"));
+ mir_free(tmp);
+ }
+ f.close();
+ DeleteFile(path.c_str());
+ }
+ {
+ if(str.length() > 0)
+ {
+ mir_free((void**)pre->szMessage);
+ char *utf = mir_utf8encodeW(str.c_str());
+ pre->szMessage = utf;
return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
}
|