summaryrefslogtreecommitdiff
path: root/plugins/HTTPServer/src/main.cpp
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/main.cpp
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/main.cpp')
-rw-r--r--plugins/HTTPServer/src/main.cpp15
1 files changed, 10 insertions, 5 deletions
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);