From 4969bb22850417cfafe9ef66523dab1906116aeb Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Mon, 21 Jan 2013 19:25:08 +0000 Subject: - HTTPServer: stdafx.cpp added for constant hashes - Another portion of _T replacement (patch from person) git-svn-id: http://svn.miranda-ng.org/main/trunk@3219 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/src/Glob.h | 2 +- plugins/HTTPServer/src/main.cpp | 15 ++++++++++----- plugins/HTTPServer/src/stdafx.cpp | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 plugins/HTTPServer/src/stdafx.cpp (limited to 'plugins/HTTPServer/src') diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index 3eabbbb190..7a2001b0a3 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -58,7 +58,7 @@ using namespace std; #define SD_BOTH 0x02 #define MODULE "HTTPServer" -#define MSG_BOX_TITEL TranslateT("Miranda (HTTPServer.dll)") +#define MSG_BOX_TITEL TranslateT("Miranda NG HTTP-Server)") #define SplitIpAddress( p ) (BYTE)(p>>24),(BYTE)(p>>16),(BYTE)(p>>8),(BYTE)(p) diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 3c45bdfaab..182c50ea31 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -151,7 +151,7 @@ bool bWriteToFile(HANDLE hFile, const char * pszSrc, int nLen = -1) { // Developer : KN ///////////////////////////////////////////////////////////////////// -void LogEvent(const char * pszTitle, const char * pszLog) { +void LogEvent(const TCHAR * pszTitle, const char * pszLog) { HANDLE hFile = CreateFile(sLogFilePath.c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { MessageBox(NULL, TranslateT("Failed to open or create log file"), MSG_BOX_TITEL, MB_OK); @@ -331,17 +331,20 @@ bool bReadConfigurationFile() { bool bWriteConfigurationFile() { CLFileShareListAccess clCritSection; char szBuf[1000]; + TCHAR * temp = ""; strcpy(szBuf, szPluginPath); strcat(szBuf, szConfigFile); HANDLE hFile = CreateFile(szBuf, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { - MessageBox(NULL, _T("Failed to open or create file ") szConfigFile, MSG_BOX_TITEL, MB_OK); + mir_sntprintf(temp, sizeof(temp), "%s%s", TranslateT("Failed to open or create file "), _T(szConfigFile)); + MessageBox(NULL, temp , MSG_BOX_TITEL, MB_OK); return false; } DWORD dwBytesWriten = 0; if (! WriteFile(hFile, szXmlHeader, sizeof(szXmlHeader) - 1, &dwBytesWriten, NULL)) { - MessageBox(NULL, _T("Failed to write xml header to file ") szConfigFile, MSG_BOX_TITEL, MB_OK); + mir_sntprintf(temp, sizeof(temp), "%s%s", TranslateT("Failed to write xml header to file "), _T(szConfigFile)); + MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK); } else { CLFileShareNode * pclCur = pclFirstNode; while (pclCur) { @@ -353,14 +356,16 @@ bool bWriteConfigurationFile() { SplitIpAddress(pclCur->st.dwAllowedMask)); if (! WriteFile(hFile, szBuf, dwBytesToWrite, &dwBytesWriten, NULL)) { - MessageBox(NULL, _T("Failed to write xml data to file ") szConfigFile, MSG_BOX_TITEL, MB_OK); + mir_sntprintf(temp, sizeof(temp), "%s%s", TranslateT("Failed to write xml data to file "), _T(szConfigFile)); + MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK); break; } pclCur = pclCur->pclNext; } if (! WriteFile(hFile, szXmlTail, sizeof(szXmlTail) - 1, &dwBytesWriten, NULL)) { - MessageBox(NULL, _T("Failed to write xml tail to file ") szConfigFile, MSG_BOX_TITEL, MB_OK); + mir_sntprintf(temp, sizeof(temp), "%s%s", TranslateT("Failed to write xml tail to file "), _T(szConfigFile)); + MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK); } } SetEndOfFile(hFile); diff --git a/plugins/HTTPServer/src/stdafx.cpp b/plugins/HTTPServer/src/stdafx.cpp new file mode 100644 index 0000000000..a57357188e --- /dev/null +++ b/plugins/HTTPServer/src/stdafx.cpp @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012 Miranda NG team (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "Glob.h" \ No newline at end of file -- cgit v1.2.3