summaryrefslogtreecommitdiff
path: root/plugins/HTTPServer/src
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2013-01-21 19:25:08 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2013-01-21 19:25:08 +0000
commit4969bb22850417cfafe9ef66523dab1906116aeb (patch)
tree2d369044db1e9f0673cc943168dff0943ceb3651 /plugins/HTTPServer/src
parent1fce2593d772e94e469bf02547dda26d4a939425 (diff)
- 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
Diffstat (limited to 'plugins/HTTPServer/src')
-rw-r--r--plugins/HTTPServer/src/Glob.h2
-rw-r--r--plugins/HTTPServer/src/main.cpp15
-rw-r--r--plugins/HTTPServer/src/stdafx.cpp18
3 files changed, 29 insertions, 6 deletions
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 <http://www.gnu.org/licenses/>.
+*/
+
+#include "Glob.h" \ No newline at end of file