summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xplugins/Msg_Export/src/FileViewer.cpp38
-rwxr-xr-xplugins/Msg_Export/src/main.cpp16
-rwxr-xr-xplugins/Msg_Export/src/options.cpp14
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp131
-rwxr-xr-xplugins/Msg_Export/src/utils.h19
5 files changed, 88 insertions, 130 deletions
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp
index 1ca4192b73..32f7d23f58 100755
--- a/plugins/Msg_Export/src/FileViewer.cpp
+++ b/plugins/Msg_Export/src/FileViewer.cpp
@@ -234,7 +234,7 @@ int CLStreamRTFInfo::nWriteHeader( char * pszTarget , int nLen )
if( nSrcLen > nLen )
{
- MessageBox( NULL , _T("Failed to write to the RichEdit the buffer was to small."),MSG_BOX_TITEL,MB_OK );
+ MessageBox( NULL , LPGENT("Failed to write to the RichEdit the buffer was to small."),MSG_BOX_TITEL,MB_OK );
return 0; // target buffer to small
}
@@ -267,7 +267,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff , LONG cb )
if( nOptimalReadLen < 500 )
{
- MessageBox( NULL , _T("Error: Optimal buffer size decrecied to a to low size !!"),MSG_BOX_TITEL,MB_OK );
+ MessageBox( NULL , LPGENT("Error: Optimal buffer size decrecied to a to low size !!"),MSG_BOX_TITEL,MB_OK );
return 0;
}
@@ -290,12 +290,8 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff , LONG cb )
dwCurrent += nWriteHeader( (char*)pbBuff , cb );
tstring sMyNick = NickFromHandle(0);
-#ifdef _UNICODE
- nNickLen = WideCharToMultiByte(bUtf8File ? CP_UTF8 : CP_ACP , 0, sMyNick.c_str(), sMyNick.length() , szMyNick , sizeof( szMyNick ), NULL , NULL );
-#else
- strcpy( szMyNick , sMyNick.c_str() );
- nNickLen = sMyNick.length();
-#endif
+
+ nNickLen = WideCharToMultiByte(bUtf8File ? CP_UTF8 : CP_ACP , 0, sMyNick.c_str(), (int)sMyNick.length() , szMyNick , sizeof( szMyNick ), NULL , NULL );
}
else
{
@@ -361,7 +357,7 @@ int CLStreamRTFInfo::nLoadFileStream( LPBYTE pbBuff , LONG cb )
LONG lExtraRead = (n+1) - dwRead;
if( lExtraRead >= 0 )
- MessageBox( NULL , _T("Internal error !! (lExtraRead >= 0)"),MSG_BOX_TITEL,MB_OK );
+ MessageBox( NULL , LPGENT("Internal error !! (lExtraRead >= 0)"),MSG_BOX_TITEL,MB_OK );
SetFilePointer( hFile , lExtraRead , NULL , FILE_CURRENT );
bCheckFirstForNick = true;
return dwCurrent;
@@ -556,7 +552,7 @@ bool bOpenExternaly( HANDLE hContact )
&sStartupInfo,
&stProcesses ) )
{
- DisplayLastError( _T("Faile to execute external file view") );
+ DisplayLastError( LPGENT("Faile to execute external file view") );
}
return true;
}
@@ -601,7 +597,7 @@ bool bUseInternalViewer( bool bNew )
hRichEditDll = LoadLibraryA("RICHED32.DLL");
if( !hRichEditDll )
{
- DisplayLastError( _T("Failed to load Rich Edit ( RICHED32.DLL )" ));
+ DisplayLastError( LPGENT("Failed to load Rich Edit ( RICHED32.DLL )" ));
return false;
}
}
@@ -609,7 +605,7 @@ bool bUseInternalViewer( bool bNew )
{
if( ::FreeLibrary(hRichEditDll) == 0 )
{
- DisplayLastError( _T("Failed to unload Rich Edit ( RICHED32.DLL )") );
+ DisplayLastError( LPGENT("Failed to unload Rich Edit ( RICHED32.DLL )") );
hRichEditDll = NULL;
return false;
}
@@ -693,7 +689,7 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg )
HWND hRichEdit = GetDlgItem( hwndDlg , IDC_RICHEDIT );
if( ! hRichEdit )
{
- MessageBox( hwndDlg , _T("Failed to get handle to RichEdit!"),MSG_BOX_TITEL,MB_OK );
+ MessageBox( hwndDlg , LPGENT("Failed to get handle to RichEdit!"),MSG_BOX_TITEL,MB_OK );
return false;
}
@@ -710,11 +706,11 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg )
if( nDBCount == -1 )
{
- mir_sntprintf(szTmp, 1499, _T("Failed to open file\r\n%s\r\n\r\nContact handle is invalid") , pclDlg->sPath.c_str());
+ mir_sntprintf(szTmp, 1499, LPGENT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid") , pclDlg->sPath.c_str());
}
else
{
- mir_sntprintf( szTmp , 1499, _T("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events") , pclDlg->sPath.c_str() , nDBCount );
+ mir_sntprintf( szTmp , 1499, LPGENT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events") , pclDlg->sPath.c_str() , nDBCount );
}
SETTEXTEX stText = {0};
@@ -784,7 +780,7 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg )
//delete [] pabFileData;
_TCHAR szTmp[100];
- mir_sntprintf( szTmp , 99, _T("File open time %d\n") , GetTickCount() - dwStart );
+ mir_sntprintf( szTmp , 99, LPGENT("File open time %d\n") , GetTickCount() - dwStart );
OutputDebugString( szTmp );
@@ -798,7 +794,7 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg )
if( ! bScrollToBottom )
SendMessage( hRichEdit , EM_SETSCROLLPOS , 0 , (LPARAM) &ptOldPos );
- mir_sntprintf( szTmp , 99, _T("With scroll to bottom %d\n") , GetTickCount() - dwStart );
+ mir_sntprintf( szTmp , 99, LPGENT("With scroll to bottom %d\n") , GetTickCount() - dwStart );
OutputDebugString( szTmp );
return true;
@@ -1303,7 +1299,7 @@ static BOOL CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if( hFile == INVALID_HANDLE_VALUE )
{
- DisplayLastError( _T("Failed to create file") );
+ DisplayLastError( LPGENT("Failed to create file") );
return TRUE;
}
@@ -1314,12 +1310,12 @@ static BOOL CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, LP
int nWriteOk = SendMessage(hRichEdit, EM_STREAMOUT, (WPARAM)SF_RTF , (LPARAM)&eds);
if( nWriteOk <= 0 || eds.dwError != 0 )
{
- DisplayLastError( _T("Failed to save file") );
+ DisplayLastError( LPGENT("Failed to save file") );
CloseHandle( hFile );
return TRUE;
}
CloseHandle( hFile );
- tstring sReport = _T("History was saved successfully in file\r\n");
+ tstring sReport = LPGENT("History was saved successfully in file\r\n");
sReport += sFile;
MessageBox( NULL , sReport.c_str() ,MSG_BOX_TITEL ,MB_OK );
return TRUE;
@@ -1417,7 +1413,7 @@ bool bShowFileViewer( HANDLE hContact )
ShowWindow( pcl->hWnd , SW_SHOWNORMAL );
return true;
}
- DisplayLastError( _T("Failed to create history dialog") );
+ DisplayLastError( LPGENT("Failed to create history dialog") );
delete pcl;
return false;
}
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp
index 79e4b0bba4..d7854d6d36 100755
--- a/plugins/Msg_Export/src/main.cpp
+++ b/plugins/Msg_Export/src/main.cpp
@@ -60,11 +60,7 @@ PLUGININFOEX pluginInfo = {
"© 2002 Kennet Nielsen",
"http://sourceforge.net/projects/msg-export/",
UNICODE_AWARE,
- #ifdef _UNICODE
{ 0x46102b07, 0xc215, 0x4162, { 0x9c, 0x83, 0xd3, 0x77, 0x88, 0x1d, 0xa7, 0xcc } } // {46102B07-C215-4162-9C83-D377881DA7CC}
- #else
- { 0x13ff3b7e, 0x4976, 0x471f, { 0xa4, 0x75, 0x16, 0x62, 0xa4, 0xdd, 0xc, 0x3e } } // {13FF3B7E-4976-471f-A475-1662A4DD0C3E}
- #endif
};
@@ -171,17 +167,17 @@ int MainInit(WPARAM /*wparam*/,LPARAM /*lparam*/)
hDBEventAdded = HookEvent( ME_DB_EVENT_ADDED , nExportEvent );
if( !hDBEventAdded )
- MessageBox( NULL , _T("Failed to HookEvent ME_DB_EVENT_ADDED") , MSG_BOX_TITEL , MB_OK );
+ MessageBox( NULL , LPGENT("Failed to HookEvent ME_DB_EVENT_ADDED") , MSG_BOX_TITEL , MB_OK );
hDBContactDeleted = HookEvent( ME_DB_CONTACT_DELETED , nContactDeleted );
if( !hDBContactDeleted )
- MessageBox( NULL , _T("Failed to HookEvent ME_DB_CONTACT_DELETED") , MSG_BOX_TITEL , MB_OK );
+ MessageBox( NULL , LPGENT("Failed to HookEvent ME_DB_CONTACT_DELETED") , MSG_BOX_TITEL , MB_OK );
hEventOptionsInitialize = HookEvent( ME_OPT_INITIALISE , OptionsInitialize );
if( !hEventOptionsInitialize )
- MessageBox( NULL , _T("Failed to HookEvent ME_OPT_INITIALISE") , MSG_BOX_TITEL , MB_OK );
+ MessageBox( NULL , LPGENT("Failed to HookEvent ME_OPT_INITIALISE") , MSG_BOX_TITEL , MB_OK );
CLISTMENUITEM mi;
@@ -206,7 +202,7 @@ int MainInit(WPARAM /*wparam*/,LPARAM /*lparam*/)
hOpenHistoryMenuItem = Menu_AddContactMenuItem(&mi);
if( !hOpenHistoryMenuItem )
- MessageBox( NULL , _T("Failed to add menu item Open Exported History\nCallService(MS_CLIST_ADDCONTACTMENUITEM,...)") , MSG_BOX_TITEL , MB_OK );
+ MessageBox( NULL , LPGENT("Failed to add menu item Open Exported History\nCallService(MS_CLIST_ADDCONTACTMENUITEM,...)") , MSG_BOX_TITEL , MB_OK );
/*
hEventSystemShutdown = HookEvent( ME_SYSTEM_SHUTDOWN , nSystemShutdown );
@@ -314,7 +310,7 @@ int __declspec(dllexport)Load()
if( !hEventSystemInit )
{
- MessageBox( NULL , _T("Failed to HookEvent ME_SYSTEM_MODULESLOADED") , MSG_BOX_TITEL , MB_OK );
+ MessageBox( NULL , LPGENT("Failed to HookEvent ME_SYSTEM_MODULESLOADED") , MSG_BOX_TITEL , MB_OK );
return 0;
}
@@ -369,7 +365,7 @@ int __declspec(dllexport)Load()
if( ! hServiceFunc )
{
- MessageBox( NULL , _T("Failed to CreateServiceFunction MS_SHOW_EXPORT_HISTORY") , MSG_BOX_TITEL , MB_OK );
+ MessageBox( NULL , LPGENT("Failed to CreateServiceFunction MS_SHOW_EXPORT_HISTORY") , MSG_BOX_TITEL , MB_OK );
}
return 0;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index ec34cfbfe0..81eae0979b 100755
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -407,7 +407,7 @@ BOOL bApplyChanges( HWND hwndDlg )
int nTmp = GetDlgItemInt( hwndDlg , IDC_MAX_CLOUMN_WIDTH , &bTrans , TRUE );
if( !bTrans || nTmp < 5 )
{
- _sntprintf( szTemp , sizeof( szTemp ) ,CheckedTranslate(_T("Max line width must be at least %d"),1) , 5 );
+ _sntprintf( szTemp , sizeof( szTemp ) ,LPGENT("Max line width must be at least %d"), 5 );
MessageBox( hwndDlg , szTemp ,MSG_BOX_TITEL,MB_OK );
bRet = false;
}
@@ -562,7 +562,7 @@ void AutoFindeFileNames(HWND hwndDlg)
sItem.cchTextMax = sizeof( szSubCur );
if( ListView_GetItem( hMapUser, &sItem ) )
{
- int nLen = _tcslen( szSubCur );
+ size_t nLen = _tcslen( szSubCur );
if( _tcsncicmp( szSubCur , szSearch , nLen ) == 0 )
{
if( nLen < nShortestMatch )
@@ -630,7 +630,7 @@ void OpenHelp(HWND hwndDlg)
_TCHAR szPath[MAX_PATH];
if( GetModuleFileName( hInstance , szPath , sizeof( szPath ) ) )
{
- int nLen = _tcslen( szPath );
+ size_t nLen = _tcslen( szPath );
if( nLen > 3 )
{
szPath[nLen-1] = 't';
@@ -955,7 +955,7 @@ static BOOL CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
ofn.hwndOwner = hwndDlg;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
- ofn.lpstrFilter = _T("Executable files (*.exe;*.com;*.bat;*.cmd)\0*.exe;*.com;*.bat;*.cmd\0All files(*.*)\0*.*\0");
+ ofn.lpstrFilter = LPGENT("Executable files (*.exe;*.com;*.bat;*.cmd)\0*.exe;*.com;*.bat;*.cmd\0All files(*.*)\0*.*\0");
ofn.nFilterIndex = 1;
//ofn.lpstrFileTitle = NULL;
//ofn.nMaxFileTitle = 0;
@@ -982,7 +982,7 @@ static BOOL CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
// Get the shells allocator
if (FAILED(SHGetMalloc(&pMalloc))) // we need to use this to support old Windows versions
{
- MessageBox( hwndDlg , _T("Failed to get the shells allocator !"),MSG_BOX_TITEL,MB_OK );
+ MessageBox( hwndDlg , LPGENT("Failed to get the shells allocator !"),MSG_BOX_TITEL,MB_OK );
return TRUE; // TRUE because we have handled the message , sort of *S*
}
@@ -991,7 +991,7 @@ static BOOL CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if ( ! lpDestDir )
{
pMalloc->Release();
- MessageBox( hwndDlg , _T("Failed to Allocate buffer space"),MSG_BOX_TITEL,MB_OK );
+ MessageBox( hwndDlg , LPGENT("Failed to Allocate buffer space"),MSG_BOX_TITEL,MB_OK );
return TRUE;
}
@@ -1009,7 +1009,7 @@ static BOOL CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if( psItemIDList )
{
SHGetPathFromIDList(psItemIDList, lpDestDir);
- int n = _tcslen( lpDestDir );
+ size_t n = _tcslen( lpDestDir );
if( n > 0 && lpDestDir[n] != '\\' )
{
lpDestDir[n] = '\\' ;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 255167e4ab..0c5186a021 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -24,14 +24,12 @@
#include "Utils.h"
#include "FileViewer.h"
-#pragma warning (disable:4996)
#include <m_protosvc.h>
#include <m_icq.h>
-#pragma warning (default:4996)
// Default error string used upon errors
-const _TCHAR *pszNickError = _T("No_Nick");
-const _TCHAR *pszGroupError = _T("No_Group");
+const _TCHAR *pszNickError = LPGENT("No_Nick");
+const _TCHAR *pszGroupError = LPGENT("No_Group");
const _TCHAR *pszDbPathError = _T(".");
// Replacement for chareteres not alowed in file names.
@@ -176,8 +174,8 @@ int nGetFormatCount( const _TCHAR * pszToCheck )
// Created : 030107 , 07 January 2003
// Developer : KN
/////////////////////////////////////////////////////////////////////
-
-_TCHAR * CheckedTranslate( const _TCHAR *szEng , int nFormatCount /*= -1*/ )
+/*
+_TCHAR * CheckedTranslate( const _TCHAR *szEng , int nFormatCount )//= -1
{
_TCHAR * szRet = TranslateTS( szEng );
if( szEng == szRet )
@@ -197,7 +195,7 @@ _TCHAR * CheckedTranslate( const _TCHAR *szEng , int nFormatCount /*= -1*/ )
}
return szRet;
}
-
+*/
/////////////////////////////////////////////////////////////////////
// Member Function : sGetErrorString
// Type : Global
@@ -246,7 +244,7 @@ void DisplayLastError(const _TCHAR * pszError)
DWORD error = GetLastError();
_TCHAR szTemp[50];
- _sntprintf( szTemp , sizeof( szTemp ) , _T("\r\nErrorCode : %d\r\n") , error );
+ _sntprintf( szTemp , sizeof( szTemp ) , LPGENT("\r\nErrorCode : %d\r\n") , error );
sError += szTemp;
sError += sGetErrorString(error);
MessageBox( NULL , sError.c_str() ,MSG_BOX_TITEL ,MB_OK );
@@ -299,7 +297,7 @@ tstring _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting
{
if( dbv.type != DBVT_WCHAR)
{
- MessageBox(NULL,_T("DB: Attempt to get wrong type of value, string"),MSG_BOX_TITEL,MB_OK);
+ MessageBox(NULL, LPGENT("DB: Attempt to get wrong type of value, string"), MSG_BOX_TITEL,MB_OK);
ret = pszError;
}
else
@@ -321,7 +319,7 @@ string _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting
{
if( dbv.type != DBVT_ASCIIZ)
{
- MessageBox(NULL,_T("DB: Attempt to get wrong type of value, string"),MSG_BOX_TITEL,MB_OK);
+ MessageBox(NULL, LPGENT("DB: Attempt to get wrong type of value, string"), MSG_BOX_TITEL,MB_OK);
ret = pszError;
}
else
@@ -457,42 +455,21 @@ bool bWriteTextToFile( HANDLE hFile , const _TCHAR * pszSrc , bool bUtf8File ,in
nLen = _tcslen( pszSrc );
if( ! bUtf8File )
{
-#ifdef _UNICODE // We need to downgrade text to ansi
+// We need to downgrade text to ansi
char * pszAstr = new char[nLen];
int nAnsiLen = WideCharToMultiByte(CP_ACP, 0, pszSrc, nLen, pszAstr , nLen , NULL , NULL );
bool bRet = bWriteToFile( hFile , pszAstr , nAnsiLen );
delete [] pszAstr;
return bRet;
-#else
- return bWriteToFile( hFile , pszSrc , nLen );
-#endif
- }
-#ifndef _UNICODE
- wchar_t * pszWstr = new wchar_t[nLen];
- if( MultiByteToWideChar(CP_ACP, 0, pszSrc, nLen, pszWstr, nLen ) != nLen )
- {
- delete [] pszWstr;
- return false;
- }
- char * pszUtf8 = new char[nLen*2];// Ansi can't generate more then this.
- int nUtf8Len = WideCharToMultiByte(CP_UTF8, 0, pszWstr, nLen, pszUtf8 , nLen * 2 , NULL , NULL );
- delete [] pszWstr;
- if( nUtf8Len < nLen ) // Not all was converted ?
- {
- delete [] pszUtf8;
- return false;
}
- bool bRet = bWriteToFile( hFile , pszUtf8 , nUtf8Len );
- delete [] pszUtf8;
-#else
char * pszUtf8 = new char[nLen*3];// UCS-2 can't generate more then this.
int nUtf8Len = WideCharToMultiByte(CP_UTF8, 0, pszSrc, nLen, pszUtf8 , nLen * 3 , NULL , NULL );
bool bRet = bWriteToFile( hFile , pszUtf8 , nUtf8Len );
-#endif
+
return bRet;
}
-#ifdef _UNICODE
+
bool bWriteTextToFile( HANDLE hFile , const char * pszSrc , bool bUtf8File ,int nLen = -1 )
{
if( nLen == -1 )
@@ -505,8 +482,6 @@ bool bWriteTextToFile( HANDLE hFile , const char * pszSrc , bool bUtf8File ,int
}
return bRet;
}
-#endif
-
/////////////////////////////////////////////////////////////////////
// Member Function : bWriteNewLine
@@ -688,7 +663,7 @@ tstring GetFilePathFromUser( HANDLE hContact )
{
tstring sRemoteUser = NickFromHandle(hContact);
_sntprintf( szTemp , sizeof( szTemp ) ,
- CheckedTranslate(_T("File name for the user \"%s\" has changed !\n\nfrom:\t%s\nto:\t%s\n\nDo you wish to rename file ?"),3) ,
+ LPGENT("File name for the user \"%s\" has changed !\n\nfrom:\t%s\nto:\t%s\n\nDo you wish to rename file ?"),
sRemoteUser.c_str(),
sPrevFileName.c_str(),
sFilePath.c_str() );
@@ -709,7 +684,7 @@ tstring GetFilePathFromUser( HANDLE hContact )
while( ! MoveFile( sPrevFileName.c_str(), sFilePath.c_str() ) )
{
_sntprintf( szTemp , sizeof( szTemp ) ,
- CheckedTranslate(_T("Failed to rename file\n\nfrom:\t%s\nto:\t%s\n\nFailed with error: %s"),3) ,
+ LPGENT("Failed to rename file\n\nfrom:\t%s\nto:\t%s\n\nFailed with error: %s"),
sPrevFileName.c_str(),
sFilePath.c_str() ,
sGetErrorString().c_str() );
@@ -971,7 +946,7 @@ void DisplayErrorDialog( const _TCHAR * pszError , tstring& sFilePath , DBEVENTI
{
tstring sError = TranslateTS( pszError );
sError += sFilePath;
- sError += _T("\nError :");
+ sError += LPGENT("\nError :");
sError += sGetErrorString();
sError += _T("\n");
sError += LPGENT("Message has not been saved !\n");
@@ -1062,7 +1037,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
if( hFile == INVALID_HANDLE_VALUE )
{
- DisplayErrorDialog( _T("Failed to open or create file :\n") , sFilePath , NULL );
+ DisplayErrorDialog( LPGENT("Failed to open or create file :\n") , sFilePath , NULL );
return;
}
@@ -1106,7 +1081,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
// we need to aborte mission here because if we continue we risk
// overwriting old log.
- DisplayErrorDialog( _T("Failed to move to the end of the file :\n") , sFilePath , NULL );
+ DisplayErrorDialog( LPGENT("Failed to move to the end of the file :\n") , sFilePath , NULL );
CloseHandle( hFile );
return;
}
@@ -1118,27 +1093,27 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
if( ! bWriteToFile( hFile , szUtf8ByteOrderHeader, sizeof( szUtf8ByteOrderHeader ) - 1 ) )
{
- DisplayErrorDialog( _T("Failed to UTF8 byte order code to file :\n") , sFilePath , NULL );
+ DisplayErrorDialog( LPGENT("Failed to UTF8 byte order code to file :\n") , sFilePath , NULL );
CloseHandle( hFile );
return;
}
}
tstring output = _T("------------------------------------------------\r\n")
- _T(" History for\r\n")
- _T("User : %User%\r\n")
- _T("Protocol : %Proto%\r\n")
- _T("UIN : %UIN%\r\n")
- _T("FirstName : %FirstName%\r\n")
- _T("LastName : %LastName%\r\n")
- _T("Age : %Age%\r\n")
- _T("Gender : %Gender%\r\n")
- _T("e-mail : %e-mail%\r\n")
- _T("Nick : %Nick% \r\n")
- _T("City : %City%\r\n")
- _T("State : %State%\r\n")
- _T("Phone : %Phone%\r\n")
- _T("Homepage : %Homepage%\r\n")
- _T("- About -\r\n%About%\r\n")
+ LPGENT(" History for\r\n")
+ LPGENT("User : %User%\r\n")
+ LPGENT("Protocol : %Proto%\r\n")
+ LPGENT("UIN : %UIN%\r\n")
+ LPGENT("FirstName : %FirstName%\r\n")
+ LPGENT("LastName : %LastName%\r\n")
+ LPGENT("Age : %Age%\r\n")
+ LPGENT("Gender : %Gender%\r\n")
+ LPGENT("e-mail : %e-mail%\r\n")
+ LPGENT("Nick : %Nick% \r\n")
+ LPGENT("City : %City%\r\n")
+ LPGENT("State : %State%\r\n")
+ LPGENT("Phone : %Phone%\r\n")
+ LPGENT("Homepage : %Homepage%\r\n")
+ LPGENT("- About -\r\n%About%\r\n")
_T("------------------------------------------------\r\n");
// This is written this way because I expect this will become a string the user may set
@@ -1165,7 +1140,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
if( ! bWriteTextToFile( hFile , output.data(), bWriteUTF8Format, output.size() ) )
{
- DisplayErrorDialog( _T("Failed to write user details to file :\n") , sFilePath , NULL );
+ DisplayErrorDialog( LPGENT("Failed to write user details to file :\n") , sFilePath , NULL );
CloseHandle( hFile );
return;
}
@@ -1183,18 +1158,16 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
dbtts.cbDest = sizeof(szTemp) - nIndent - 2;
dbtts.szDest = &szTemp[nIndent];
dbtts.szFormat = (_TCHAR*)sTimeFormat.c_str();
-#ifdef _UNICODE
+
CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT,dbei.timestamp,(LPARAM)&dbtts);
-#else
- CallService(MS_DB_TIME_TIMESTAMPTOSTRING,dbei.timestamp,(LPARAM)&dbtts);
-#endif
+
nIndent = _tcslen( szTemp );
szTemp[nIndent++] = ' ';
// Write first part of line with name and timestamp
if( ! bWriteTextToFile( hFile , szTemp , bWriteUTF8Format , nIndent ) )
{
- DisplayErrorDialog( _T("Failed to write timestamp and username to file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write timestamp and username to file :\n") , sFilePath , &dbei );
CloseHandle( hFile );
return;
}
@@ -1211,7 +1184,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
TCHAR* msg = DbGetEventTextT( &dbei, CP_ACP );
if( ! bWriteIndentedToFile( hFile , nIndent , msg , bWriteUTF8Format ) )
{
- DisplayErrorDialog( _T("Failed to write message to the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write message to the file :\n") , sFilePath , &dbei );
}
mir_free(msg);
break;
@@ -1285,18 +1258,18 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
if( ! bWriteOk )
- DisplayErrorDialog( _T("Failed to write URL/File to the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write URL/File to the file :\n") , sFilePath , &dbei );
break;
}
case EVENTTYPE_AUTHREQUEST:
case EVENTTYPE_ADDED:
{
const _TCHAR * pszTypes[] = {
- _T("Nick :"),
- _T("FirstName :"),
- _T("LastName :"),
- _T("e-mail :"),
- _T("Reason :")};
+ LPGENT("Nick :"),
+ LPGENT("FirstName :"),
+ LPGENT("LastName :"),
+ LPGENT("e-mail :"),
+ LPGENT("Reason :")};
/*// test code
dbei.pBlob = (BYTE*)("\xED\xA8\x29\x09nick\0first\0last\0email");
@@ -1305,9 +1278,9 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
if( dbei.cbBlob < 8 || dbei.cbBlob > 5000 )
{
- int n = _sntprintf( szTemp , sizeof( szTemp ) ,_T("Invalid Database event received. Type %d, size %d"),dbei.eventType, dbei.cbBlob );
+ int n = _sntprintf( szTemp , sizeof( szTemp ) , LPGENT("Invalid Database event received. Type %d, size %d"),dbei.eventType, dbei.cbBlob );
if( ! bWriteTextToFile( hFile , szTemp , bWriteUTF8Format , n ) )
- DisplayErrorDialog( _T("Failed to write Invalid Database event the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write Invalid Database event the file :\n") , sFilePath , &dbei );
break;
}
@@ -1357,7 +1330,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
if( ! bWriteOk )
- DisplayErrorDialog( _T("Failed to write AUTHREQUEST or ADDED to the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write AUTHREQUEST or ADDED to the file :\n") , sFilePath , &dbei );
break;
}
@@ -1408,7 +1381,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
if( ! bWriteNewLine( hFile , nIndent ) ||
! bWriteIndentedToFile( hFile , nIndent , pszStr , bWriteUTF8Format ) )
{
- DisplayErrorDialog( _T("Failed to write EmailExpress to the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write EmailExpress to the file :\n") , sFilePath , &dbei );
}
break;
}
@@ -1416,16 +1389,16 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
{
if( ! bWriteIndentedToFile( hFile , nIndent , (const char*)dbei.pBlob , bWriteUTF8Format ) )
{
- DisplayErrorDialog( _T("Failed to write SMS to the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write SMS to the file :\n") , sFilePath , &dbei );
}
break;
}
default:
{
- int n = _sntprintf( szTemp , sizeof( szTemp ) ,_T("Unknown event type %d, size %d") , dbei.eventType, dbei.cbBlob );
+ int n = _sntprintf( szTemp , sizeof( szTemp ) , LPGENT("Unknown event type %d, size %d") , dbei.eventType, dbei.cbBlob );
if( ! bWriteTextToFile( hFile , szTemp , bWriteUTF8Format , n ) )
{
- DisplayErrorDialog( _T("Failed to write Unknown event to the file :\n") , sFilePath , &dbei );
+ DisplayErrorDialog( LPGENT("Failed to write Unknown event to the file :\n") , sFilePath , &dbei );
}
break;
}
@@ -1433,7 +1406,7 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
}
else
{
- int n = _sntprintf( szTemp , sizeof( szTemp ) ,_T("Unknown event type %d, size %d") , dbei.eventType, dbei.cbBlob );
+ int n = _sntprintf( szTemp , sizeof( szTemp ) , LPGENT("Unknown event type %d, size %d") , dbei.eventType, dbei.cbBlob );
bWriteTextToFile( hFile , szTemp , bWriteUTF8Format , n );
}
bWriteToFile( hFile , bAppendNewLine ? "\r\n\r\n" : "\r\n" );
@@ -1622,7 +1595,7 @@ SuperBreak:
if( pszPrev == pszSrc )
{
// this is an programming error we have not moved forward in string
- MessageBox( NULL , _T("Programming error on line __LINE__ please report this") ,MSG_BOX_TITEL,MB_OK );
+ MessageBox( NULL , LPGENT("Programming error on line __LINE__ please report this") ,MSG_BOX_TITEL,MB_OK );
break;
}
}
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h
index f2ca584cde..1e254c7843 100755
--- a/plugins/Msg_Export/src/utils.h
+++ b/plugins/Msg_Export/src/utils.h
@@ -29,7 +29,6 @@
#endif // defined ( _MSC_VER )
#pragma warning (push, 3 )
-#pragma warning (disable:4996)
#include "stdio.h"
@@ -50,18 +49,14 @@
#include <list>
#include <string>
#include <map>
-#pragma warning (default:4996)
+
#pragma warning (pop)
using namespace std;
-#ifdef _UNICODE
- #define tstring wstring
- #define _DBGetString _DBGetStringW
-#else
- #define tstring string
- #define _DBGetString _DBGetStringA
-#endif
+
+#define tstring wstring
+#define _DBGetString _DBGetStringW
enum ENDialogAction
{
@@ -114,12 +109,10 @@ void ReplaceDefines( HANDLE hContact , tstring & sTarget );
void ReplaceTimeVariables( tstring &sRet );
bool bCreatePathToFile( tstring sFilePath );
-#ifdef _UNICODE
+
bool bWriteIndentedToFile( HANDLE hFile , int nIndent , const char * pszSrc , bool bUtf8File );
-#endif
bool bWriteIndentedToFile( HANDLE hFile , int nIndent , const _TCHAR * pszSrc , bool bUtf8File );
bool bWriteNewLine( HANDLE hFile , DWORD dwIndent );
bool bIsUtf8Header( BYTE * pucByteOrder );
-
-#endif \ No newline at end of file
+#endif