浏览代码

- Fixed build warnings
- removed local help files, point to wiki on sf
- reset no results flag when filling list

Scott Brogden 7 年之前
父节点
当前提交
23fe170d8c

+ 1 - 1
BitmapHelper.cpp

@@ -59,7 +59,7 @@ BOOL CBitmapHelper::GetCBitmap(void	*pClip2, CDC *pDC, CBitmap *pBitMap, int nMa
 						gdipBitmap->GetHeight() > 0 &&
 						gdipBitmap->GetWidth() > 0)
 					{
-						int nHeight = min(nMaxHeight, gdipBitmap->GetHeight());
+						int nHeight = min(nMaxHeight, (int)gdipBitmap->GetHeight());
 						int nWidth = (nHeight * gdipBitmap->GetWidth()) / gdipBitmap->GetHeight();
 
 						//do the resize

+ 5 - 5
CP_Main.cpp

@@ -223,7 +223,7 @@ BOOL CCP_MainApp::InitInstance()
 		//If it didn't handle the message(ditto is not running) then startup this processes of ditto 
 		//disconnected from the clipboard
 		LRESULT ret = 0;
-		HWND hWnd = (HWND)CGetSetOptions::GetMainHWND();
+		HWND hWnd = (HWND)(LONG_PTR)CGetSetOptions::GetMainHWND();
 		if(hWnd)
 		{
 			ret = ::SendMessage(hWnd, WM_SET_CONNECTED, cmdInfo.m_bConnect, cmdInfo.m_bDisconnect);
@@ -252,7 +252,7 @@ BOOL CCP_MainApp::InitInstance()
 		//If it didn't handle the message(ditto is not running) then startup this processes of ditto 
 		//disconnected from the clipboard
 		LRESULT ret = 0;
-		HWND hWnd = (HWND)CGetSetOptions::GetMainHWND();
+		HWND hWnd = (HWND)(LONG_PTR)CGetSetOptions::GetMainHWND();
 		if(hWnd)
 		{
 			ret = ::SendMessage(hWnd, WM_OPEN_CLOSE_WINDWOW, cmdInfo.m_bOpenWindow, cmdInfo.m_bCloseWindow);
@@ -263,7 +263,7 @@ BOOL CCP_MainApp::InitInstance()
 	else if (cmdInfo.m_plainTextPaste)
 	{		
 		LRESULT ret = 0;
-		HWND hWnd = (HWND)CGetSetOptions::GetMainHWND();
+		HWND hWnd = (HWND)(LONG_PTR)CGetSetOptions::GetMainHWND();
 		if (hWnd)
 		{
 			ret = ::SendMessage(hWnd, WM_PLAIN_TEXT_PASTE, NULL, NULL);
@@ -295,7 +295,7 @@ BOOL CCP_MainApp::InitInstance()
 		dwError == ERROR_ALREADY_EXISTS)
 	{
 		Log(StrF(_T("Ditto is already running, closing, mutex: %s"), csMutex));
-		HWND hWnd = (HWND)CGetSetOptions::GetMainHWND();
+		HWND hWnd = (HWND)(LONG_PTR)CGetSetOptions::GetMainHWND();
 		if(hWnd)
 			::SendMessage(hWnd, WM_SHOW_TRAY_ICON, TRUE, TRUE);
 
@@ -335,7 +335,7 @@ void CCP_MainApp::AfterMainCreate()
 {
 	m_MainhWnd = m_pMainFrame->m_hWnd;
 	ASSERT( ::IsWindow(m_MainhWnd) );
-	g_Opt.SetMainHWND((long)m_MainhWnd);
+	g_Opt.SetMainHWND((long)(LONG_PTR)m_MainhWnd);
 
 	g_HotKeys.Init(m_MainhWnd);
 

+ 1 - 2
Client.cpp

@@ -139,8 +139,7 @@ BOOL CClient::OpenConnection(const TCHAR* servername)
 	//11-5-06 Serge Baranov found that if we are passing in an ip then
 	//don't look the name up using gethostbyname/gethostbyaddr->
 	//on simple networks that don't use DNS these will fail.
-	//So now only lookup the host name if they don't provide an IP.
-
+	//So now only lookup the host name if they don't provide an IP.	
 	addr = inet_addr(csServerNameA);
 	if(addr == INADDR_NONE)
 	{

+ 6 - 7
Clip.cpp

@@ -835,14 +835,14 @@ DWORD CClip::GenerateCRC()
 					{
 						//i've seen examble where the text size was 10 but the data size was 20, leading to random crc values
 						//try and only check the crc for the actual text
-						int dataLength = GlobalSize(pCF->m_hgData);
+						int dataLength = (int)GlobalSize(pCF->m_hgData);
 						if (pCF->m_cfType == CF_TEXT)
 						{
-							dataLength = min(dataLength, (strlen((char*)Data) + 1));
+							dataLength = min(dataLength, ((int)strlen((char*)Data) + 1));
 						}
 						else if (pCF->m_cfType == CF_UNICODETEXT)
 						{
-							dataLength = min(dataLength, ((wcslen((wchar_t*)Data) + 1) * 2));
+							dataLength = min(dataLength, (((int)wcslen((wchar_t*)Data) + 1) * 2));
 						}
 						pCrc32->GenerateCrc32((const LPBYTE)Data, (DWORD)dataLength, dwCRC);
 					}
@@ -1840,7 +1840,7 @@ bool CClip::AddFileDataToData(CString &errorMessage)
 				CFileException ex;
 				if (file.Open(filePath, CFile::modeRead | CFile::typeBinary | CFile::shareDenyNone, &ex))
 				{
-					ULONGLONG fileSize = file.GetLength();
+					int fileSize = (int)file.GetLength();
 					int maxSize = CGetSetOptions::GetMaxFileContentsSize();
 					if (fileSize < maxSize)
 					{
@@ -1848,7 +1848,7 @@ bool CClip::AddFileDataToData(CString &errorMessage)
 						CStringA csFilePath;
 						CTextConvert::ConvertToUTF8(src, csFilePath);
 						
-						int bufferSize = fileSize + csFilePath.GetLength() + 1 + md5StringLength + 1;;
+						int bufferSize = (int)fileSize + csFilePath.GetLength() + 1 + md5StringLength + 1;;
 						char *pBuffer = new char[bufferSize];
 						if (pBuffer != NULL)
 						{
@@ -1857,12 +1857,11 @@ bool CClip::AddFileDataToData(CString &errorMessage)
 
 							memset(pBuffer, 0, bufferSize);
 							strncpy(pBuffer, csFilePath, csFilePath.GetLength());
-							CClipFormat* pCF;
 						
 							//move the buffer start past the file path and md5 string
 							char *bufferStart = pBuffer + csFilePath.GetLength() + 1 + md5StringLength + 1;
 
-							int readBytes = file.Read(bufferStart, fileSize);
+							int readBytes = (int)file.Read(bufferStart, fileSize);
 
 							CMd5 md5;
 							CStringA md5String = md5.CalcMD5FromString(bufferStart, fileSize);

+ 1 - 1
CustomFriendsHelper.cpp

@@ -119,7 +119,7 @@ void CCustomFriendsHelper::AddToMenu(CMenu *pMenu)
 
 void CCustomFriendsHelper::Add(CString item, CString desc)
 {
-	int count = m_list.size();
+	int count = (int)m_list.size();
 	if (count < MaxCustomFriends)
 	{
 		Name_Desc array_item;

+ 7 - 7
DeleteClipData.cpp

@@ -293,7 +293,7 @@ void CDeleteClipData::FilterItems()
 
 	//Remove from the main list the ones that don't match
 	count = rowsToDelete.size();
-	for (int i = count - 1; i >= 0; i--)
+	for (INT_PTR i = count - 1; i >= 0; i--)
 	{
 		int row = rowsToDelete[i];
 		toSelect = row;
@@ -303,7 +303,7 @@ void CDeleteClipData::FilterItems()
 
 	//Remove the rows that were filtered out but now match
 	count = filteredRowsToDelete.size();
-	for (int i = count - 1; i >= 0; i--)
+	for (INT_PTR i = count - 1; i >= 0; i--)
 	{
 		int row = filteredRowsToDelete[i];
 		m_filteredOut.erase(m_filteredOut.begin() + row);
@@ -314,7 +314,7 @@ void CDeleteClipData::FilterItems()
 		m_List.SetItemState(toSelect, LVIS_SELECTED, LVIS_SELECTED);
 	}
 	
-	m_List.SetItemCountEx(m_data.size(), 0);
+	m_List.SetItemCountEx((int)m_data.size(), 0);
 }
 
 bool CDeleteClipData::MatchesFilter(CDeleteData *pdata)
@@ -408,7 +408,7 @@ void CDeleteClipData::OnLvnItemchangedList2(NMHDR *pNMHDR, LRESULT *pResult)
 		{
 			INT_PTR row = m_List.GetNextSelectedItem(pos);
 
-			if(row >= 0 && row < m_data.size())
+			if(row >= 0 && row < (INT_PTR)m_data.size())
 			{
 				selectedDataSize += m_data[row].m_dataSize;
 				selectedCount++;
@@ -546,12 +546,12 @@ void CDeleteClipData::ApplyDelete()
 
 			CProgressWnd progress;
 			progress.Create(this, _T("Deleting clip items"), TRUE);
-			progress.SetRange(0, rowsToDelete.size() + 4);
+			progress.SetRange(0, (int)rowsToDelete.size() + 4);
 			progress.SetText(_T("Deleting selected items"));
 			progress.SetStep(1);
 
 			INT_PTR count = rowsToDelete.size();
-			for (int i = count - 1; i >= 0; i--)
+			for (INT_PTR i = count - 1; i >= 0; i--)
 			{
 				progress.PeekAndPump();
 				if (m_cancelDelete || progress.Cancelled())
@@ -618,7 +618,7 @@ void CDeleteClipData::ApplyDelete()
 			
 			FilterItems();
 
-			m_List.SetItemCountEx(m_data.size(), 0);
+			m_List.SetItemCountEx((int)m_data.size(), 0);
 		}
 		CATCH_SQLITE_EXCEPTION
 

+ 2 - 2
DittoAddins.cpp

@@ -96,7 +96,7 @@ bool CDittoAddins::AddPrePasteAddinsToMenu(CMenu *pMenu)
 					nMenuId++;
 				}
 
-				::AppendMenu(AllAddinsMenu, MF_ENABLED|MF_POPUP, (UINT)AddinMenu, pAddin->DisplayName());
+				::AppendMenu(AllAddinsMenu, MF_ENABLED|MF_POPUP, (UINT_PTR)AddinMenu, pAddin->DisplayName());
 				bRet = true;
 			}
 			else if(subCount == 1)
@@ -120,7 +120,7 @@ bool CDittoAddins::AddPrePasteAddinsToMenu(CMenu *pMenu)
 	if(bRet)
 	{
 		pMenu->InsertMenu(17, MF_BYPOSITION | MF_SEPARATOR);
-		pMenu->InsertMenu(18, MF_BYPOSITION|MF_ENABLED|MF_STRING|MF_POPUP, (UINT)AllAddinsMenu, theApp.m_Language.GetString("Add_Ins", "Add-Ins"));
+		pMenu->InsertMenu(18, MF_BYPOSITION|MF_ENABLED|MF_STRING|MF_POPUP, (UINT_PTR)AllAddinsMenu, theApp.m_Language.GetString("Add_Ins", "Add-Ins"));
 	}
 
 	return bRet;

+ 2 - 1
DittoSetup/DittoSetup_10.iss

@@ -86,7 +86,6 @@ Name: AddFireWallException; Description: Add Windows Firewall exception for Ditt
 Source: Changes.txt; DestDir: {app}
 Source: ..\Debug\Language\*; DestDir: {app}\Language; BeforeInstall: BeforeLanguageInstall()
 Source: ..\Debug\Themes\*; DestDir: {app}\Themes
-Source: ..\Help\*.htm; DestDir: {app}\Help; Flags: ignoreversion
 
 [Icons]
 Name: {group}\Ditto; Filename: {app}\Ditto.exe
@@ -151,6 +150,8 @@ var
     DeleteFile(sDir+'\icuio55.dll')
     DeleteFile(sDir+'\icuin55.dll')
     DeleteFile(sDir+'\icudt55.dll')
+	
+    DelTree(sDir+'\Help', TRUE, TRUE, TRUE)
 end;
 
 

+ 1 - 1
ExternalWindowTracker.cpp

@@ -170,7 +170,7 @@ bool ExternalWindowTracker::ActivateTarget()
 	}
 
 	// Save specified timeout period...
-	DWORD timeoutMS = 0;
+	PVOID timeoutMS = 0;
 	SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeoutMS, 0);
 	// ... then set it to zero to disable it
 	SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, (PVOID)0, 0);

+ 1 - 1
ImageViewer.cpp

@@ -132,7 +132,7 @@ void CImageViewer::OnPaint()
 			}
 
 			Gdiplus::ImageAttributes attrs;
-			Gdiplus::Rect dest(0, 0, newWidth, newHeight);
+			Gdiplus::Rect dest(0, 0, (int)newWidth, (int)newHeight);
 
 			Gdiplus::Graphics graphics(dc);
 			graphics.SetInterpolationMode(Gdiplus::InterpolationModeHighQualityBicubic);

+ 3 - 5
MainFrm.cpp

@@ -572,7 +572,7 @@ void CMainFrame::PasteOrShowGroup(int dbId, BOOL updateClipTime, BOOL activeTarg
 		
 		if(isGroup)
 		{
-			int maxDiff = CGetSetOptions::GetGroupDoubleClickTimeMS();
+			DWORD maxDiff = (DWORD)CGetSetOptions::GetGroupDoubleClickTimeMS();
 			DWORD diff = GetTickCount() - m_doubleClickGroupStartTime;		
 
 			if(m_doubleClickGroupId == dbId &&
@@ -743,7 +743,7 @@ void CMainFrame::OnTimer(UINT_PTR nIDEvent)
 
 				Log(StrF(_T("Processing single click of groupId %d in timer, opening ditto to this group"), m_doubleClickGroupId));
 
-				int maxDiff = (CGetSetOptions::GetGroupDoubleClickTimeMS() * 1.5);
+				DWORD maxDiff = (DWORD)(CGetSetOptions::GetGroupDoubleClickTimeMS() * 1.5);
 				DWORD diff = GetTickCount() - m_doubleClickGroupStartTime;					
 
 				if(diff < maxDiff)
@@ -1044,9 +1044,7 @@ CString WndName(HWND hParent)
 
 void CMainFrame::OnFirstHelp()
 {
-    CString csFile = CGetSetOptions::GetPath(PATH_HELP);
-    csFile += "DittoGettingStarted.htm";
-    CHyperLink::GotoURL(csFile, SW_SHOW);
+    CHyperLink::GotoURL(_T("https://sourceforge.net/p/ditto-cp/wiki/"), SW_SHOW);
 }
 
 void CMainFrame::ShowErrorMessage(CString csTitle, CString csMessage)

+ 1 - 1
MainFrmThread.cpp

@@ -80,7 +80,7 @@ void CMainFrmThread::OnReadDbFile()
 		CString dbFile = CGetSetOptions::GetDBPath();
 		__int64 dbSize = FileSize(dbFile);
 
-		srand(time(NULL));
+		srand((UINT)time(NULL));
 
 		int random = rand() % (dbSize - 1024) + 1;
 

+ 1 - 1
OleClipSource.cpp

@@ -1061,7 +1061,7 @@ BOOL COleClipSource::OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlob
 	else
 	{
 		if (m_pasteOptions.m_delayRenderLockout > 0 &&
-			(GetTickCount() - m_pasteOptions.m_delayRenderLockout) < CGetSetOptions::GetDelayRenderLockout())
+			(GetTickCount() - m_pasteOptions.m_delayRenderLockout) < (DWORD)CGetSetOptions::GetDelayRenderLockout())
 		{
 			bInHere = false;
 			return false;

+ 1 - 1
Options.cpp

@@ -1182,7 +1182,7 @@ void CGetSetOptions::SetMainHWND(long lhWnd)
 {	
 	SetProfileLong("MainhWnd", lhWnd);		
 }
-BOOL CGetSetOptions::GetMainHWND()				
+long CGetSetOptions::GetMainHWND()				
 {	
 	return GetProfileLong("MainhWnd", 0);	
 }

+ 1 - 1
Options.h

@@ -209,7 +209,7 @@ public:
 	static BOOL		GetShowTextForFirstTenHotKeys();
 
 	static void		SetMainHWND(long lhWnd);
-	static BOOL		GetMainHWND();
+	static long		GetMainHWND();
 
 	static void		SetCaptionPos(long lPos);
 	static long		GetCaptionPos();

+ 1 - 1
OptionsGeneral.cpp

@@ -306,7 +306,7 @@ BOOL COptionsGeneral::OnApply()
 		}
 	}
 
-	CGetSetOptions::SetQuickPastePosition(m_popupPositionCombo.GetItemData(m_popupPositionCombo.GetCurSel()));
+	CGetSetOptions::SetQuickPastePosition((int)m_popupPositionCombo.GetItemData(m_popupPositionCombo.GetCurSel()));
 
 	if (m_LogFont.lfWeight != 0)
 	{

+ 1 - 1
ProcessPaste.cpp

@@ -188,7 +188,7 @@ UINT CProcessPaste::MarkAsPastedThread(LPVOID pParam)
 		MarkAsPastedData* pData = (MarkAsPastedData*)pParam;
 		if(pData)
 		{
-			int clipCount = pData->ids.GetCount();
+			int clipCount = (int)pData->ids.GetCount();
 
 			if(g_Opt.m_bUpdateTimeOnPaste && 
 				pData->updateClipOrder &&

+ 11 - 13
QPasteWnd.cpp

@@ -1,5 +1,5 @@
-// QPasteWnd.cpp : implementation file
-//
+// This is an open source non-commercial project. Dear PVS-Studio, please check it.
+// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
 
 #include "stdafx.h"
 #include "CP_Main.h"
@@ -1453,6 +1453,7 @@ BOOL CQPasteWnd::FillList(CString csSQLSearch /*=""*/)
 		m_listItems.clear();
 	}
 
+	m_noSearchResults = false;
 	m_lstHeader.SetItemCount(0);
 	m_lstHeader.RefreshVisibleRows();
 	
@@ -2493,10 +2494,7 @@ void CQPasteWnd::OnMenuImport()
 
 void CQPasteWnd::OnMenuHelp()
 {
-    CString csFile = CGetSetOptions::GetPath(PATH_HELP);
-    csFile += "DittoGettingStarted.htm";
-
-    CHyperLink::GotoURL(csFile, SW_SHOW);
+	CHyperLink::GotoURL(_T("https://sourceforge.net/p/ditto-cp/wiki/"), SW_SHOW);
 }
 
 void CQPasteWnd::OnMenuQuickoptionsFont()
@@ -3385,7 +3383,7 @@ bool CQPasteWnd::DoActionPrevDescription()
 	
 	if (Indexes.GetCount() > 1)
 	{
-		for (int i = Indexes.GetCount()-1; i >= 0; i--)
+		for (int i = ((int)Indexes.GetCount())-1; i >= 0; i--)
 		{
 			int index = Indexes[i];
 			if (index == caret)
@@ -3397,7 +3395,7 @@ bool CQPasteWnd::DoActionPrevDescription()
 				}
 				else
 				{
-					caret = Indexes[Indexes.GetCount() - 1];
+					caret = Indexes[((int)Indexes.GetCount()) - 1];
 				}
 			}
 		}
@@ -4178,7 +4176,7 @@ bool CQPasteWnd::DoMoveClipDown()
 	if (IDs.GetCount() > 0)
 	{
 		bool sort = false;
-		for (int i = IDs.GetCount() - 1; i >= 0; i--)
+		for (int i = ((int)IDs.GetCount()) - 1; i >= 0; i--)
 		{
 			int id = IDs[i];
 			CClip clip;
@@ -4568,7 +4566,7 @@ bool CQPasteWnd::OnMakeTopSticky(bool forceSort)
 	if (IDs.GetCount() > 0)
 	{
 		bool sort = forceSort;
-		for (int i = IDs.GetCount() - 1; i >= 0; i--)
+		for (int i = ((int)IDs.GetCount()) - 1; i >= 0; i--)
 		{
 			int id = IDs[i];
 			CClip clip;
@@ -4610,7 +4608,7 @@ bool CQPasteWnd::OnMakeLastSticky()
 	if (IDs.GetCount() > 0)
 	{
 		bool sort = false;
-		for (int i = IDs.GetCount() - 1; i >= 0; i--)
+		for (int i = ((int)IDs.GetCount()) - 1; i >= 0; i--)
 		{
 			int id = IDs[i];
 			CClip clip;
@@ -4652,7 +4650,7 @@ bool CQPasteWnd::OnRemoveStickySetting()
 	if (IDs.GetCount() > 0)
 	{
 		bool sort = false;
-		for (int i = IDs.GetCount() - 1; i >= 0; i--)
+		for (int i = ((int)IDs.GetCount()) - 1; i >= 0; i--)
 		{
 			RemoveStickyInternal(IDs[i], sort);
 		}
@@ -4741,7 +4739,7 @@ bool CQPasteWnd::DoActionReplaceTopStickyClip()
 	if (IDs.GetCount() > 0)
 	{
 		bool sort = false;
-		for (int i = IDs.GetCount() - 1; i >= 0; i--)
+		for (int i = ((int)IDs.GetCount()) - 1; i >= 0; i--)
 		{
 			RemoveStickyInternal(IDs[i], sort);
 		}

+ 4 - 4
QPasteWndThread.cpp

@@ -153,12 +153,12 @@ void CQPasteWndThread::OnLoadItems(void *param)
 						else if (pos == pasteWnd->m_listItems.size())
 						{
 							pasteWnd->m_listItems.push_back(table);
-							updateIndex = pasteWnd->m_listItems.size() - 1;
+							updateIndex = (int)pasteWnd->m_listItems.size() - 1;
 							//Log(StrF(_T("adding (same size) list pos = %d, id: %d, size: %d"), pasteWnd->m_listItems.size()-1, table.m_lID, pasteWnd->m_listItems.size() - 1));
 						}
 						else if (pos > pasteWnd->m_listItems.size())
 						{
-							for (int toAdd = pasteWnd->m_listItems.size()-1; toAdd < pos - 1; toAdd++)
+							for (int toAdd = (int)pasteWnd->m_listItems.size()-1; toAdd < pos - 1; toAdd++)
 							{
 								CMainTable empty;
 								empty.m_lID = -1;
@@ -169,7 +169,7 @@ void CQPasteWndThread::OnLoadItems(void *param)
 
 							pasteWnd->m_listItems.push_back(table);
 
-							updateIndex = pasteWnd->m_listItems.size() - 1;
+							updateIndex = (int)pasteWnd->m_listItems.size() - 1;
 
 							//Log(StrF(_T("adding list pos = %d, id: %d, size: %d"), pasteWnd->m_listItems.size()-1, table.m_lID, pasteWnd->m_listItems.size() - 1));
 						}
@@ -257,7 +257,7 @@ void ReduceMapItems(CF_DibTypeMap &mapItem, CCriticalSection &critSection, CStri
 	if (mapItem.size() > maxSize)
 	{
 		//create a vector so we can sort and keep the last x number of events
-		std:vector<INT64> counterArray;
+		vector<INT64> counterArray;
 		for (CF_DibTypeMap::iterator iterDib = mapItem.begin(); iterDib != mapItem.end(); iterDib++)
 		{
 			counterArray.push_back(iterDib->second.m_counter);

+ 3 - 3
QuickPasteKeyboard.cpp

@@ -551,7 +551,7 @@ int CQuickPasteKeyboard::SelectedCommandRow()
 int CQuickPasteKeyboard::SelectedCommandShortCutId()
 {
 	int index = m_assignedCombo.GetCurSel();
-	int shortCutId = m_assignedCombo.GetItemData(index);
+	int shortCutId = (int)m_assignedCombo.GetItemData(index);
 
 	return shortCutId;
 }
@@ -718,7 +718,7 @@ void CQuickPasteKeyboard::SelectMouseTypeCombo(CComboBox &combo, int value)
 	int count = combo.GetCount();
 	for (int i = 0; i < count; i++)
 	{
-		int itemData = combo.GetItemData(i);
+		int itemData = (int)combo.GetItemData(i);
 		if (itemData == value)
 		{
 			combo.SetCurSel(i);
@@ -863,7 +863,7 @@ void CQuickPasteKeyboard::OnBnClickedButtonReset()
 	int count = m_list.GetItemCount();
 	for (int row = 0; row < count; row++)
 	{
-		int actionId = m_list.GetItemData(row);
+		int actionId = (int)m_list.GetItemData(row);
 		
 		CString sh = GetShortCutText(m_map[actionId]);
 

+ 223 - 223
RecieveSocket.cpp

@@ -1,127 +1,127 @@
-#include "StdAfx.h"
-#include "RecieveSocket.h"
-#include "Options.h"
-#include "Misc.h"
-#include "CP_Main.h"
-#include "shared/TextConvert.h"
-
-CRecieveSocket::CRecieveSocket(SOCKET sock)
-{
-	m_pDataReturnedFromDecrypt = NULL;
-	m_Sock = sock;
-	m_pEncryptor = new CEncryption; //CreateEncryptionInterface("encryptdecrypt.dll");
-	m_pProgress = NULL;
-}
-
-CRecieveSocket::~CRecieveSocket()
-{
-	if(m_pEncryptor)
-	{
-		m_pEncryptor->FreeBuffer(m_pDataReturnedFromDecrypt);
-
-		delete m_pEncryptor;
-		m_pEncryptor = NULL;
-	}
-}
-
-void CRecieveSocket::FreeDecryptedData()
-{ 
-	if(g_Opt.m_csPassword == "")
-	{
-		delete [] m_pDataReturnedFromDecrypt;
-	}
-	else
-	{
-		m_pEncryptor->FreeBuffer(m_pDataReturnedFromDecrypt);
-	}
-	m_pDataReturnedFromDecrypt = NULL;
-}
-
-LPVOID CRecieveSocket::ReceiveEncryptedData(long lInSize, long &lOutSize)
-{
-	if(m_pEncryptor == NULL)
-	{
-		LogSendRecieveInfo("ReceiveEncryptedData::Encryption not initialized");
-		return NULL;
-	}
-
-	if(m_pDataReturnedFromDecrypt)
-		FreeDecryptedData();
-
-	char *pInput = new char[lInSize];
-
-	UCHAR* pOutput = NULL;
-	
-	if(pInput)
-	{
-		int nOut = 0;
-
-		if(RecieveExactSize(pInput, lInSize))
-		{
-			CStringA csPassword;
-			INT_PTR count = g_Opt.m_csNetworkPasswordArray.GetSize();
-			INT_PTR nIndex;
-			for(int i = -2; i < count; i++)
-			{
-				csPassword.Empty();
-				nIndex = i;
-
-				//First time through try the last index that was valid
-				if(i == -2)
-				{
-					nIndex = theApp.m_lLastGoodIndexForNextworkPassword;
-					if(nIndex == -2)
-						continue;
-				}
-
-				if(nIndex == -1)
-				{
-					csPassword = g_Opt.m_csPassword;
-				}
-				else
-				{
-					if(nIndex >= 0 && nIndex < count)
-					{
-						CTextConvert::ConvertToUTF8(g_Opt.m_csNetworkPasswordArray[nIndex], csPassword);
-					}
-					else
-					{
-						continue;
-					}
-				}
-
-				if(m_pEncryptor->Decrypt((UCHAR*)pInput, lInSize, csPassword, pOutput, nOut) == FALSE)
-				{
-					LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: Failed to Decrypt data password = %s"), g_Opt.m_csPassword));
-				}
-				else
-				{
-					theApp.m_lLastGoodIndexForNextworkPassword = (long)nIndex;
-					break;
-				}
-			}
-		}
-		else
-		{
-			LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: FAILED"), lInSize));
-		}
-
-		lOutSize = nOut;
-
-		delete [] pInput;
-		pInput = NULL;
-	}	
-	else
-	{
-		ASSERT(FALSE);
-		LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: Failed to create new data size = %d"), lInSize));
-	}
-
-	m_pDataReturnedFromDecrypt = pOutput;
-
-	return pOutput;
-}
-
+#include "StdAfx.h"
+#include "RecieveSocket.h"
+#include "Options.h"
+#include "Misc.h"
+#include "CP_Main.h"
+#include "shared/TextConvert.h"
+
+CRecieveSocket::CRecieveSocket(SOCKET sock)
+{
+	m_pDataReturnedFromDecrypt = NULL;
+	m_Sock = sock;
+	m_pEncryptor = new CEncryption; //CreateEncryptionInterface("encryptdecrypt.dll");
+	m_pProgress = NULL;
+}
+
+CRecieveSocket::~CRecieveSocket()
+{
+	if(m_pEncryptor)
+	{
+		m_pEncryptor->FreeBuffer(m_pDataReturnedFromDecrypt);
+
+		delete m_pEncryptor;
+		m_pEncryptor = NULL;
+	}
+}
+
+void CRecieveSocket::FreeDecryptedData()
+{ 
+	if(g_Opt.m_csPassword == "")
+	{
+		delete [] m_pDataReturnedFromDecrypt;
+	}
+	else
+	{
+		m_pEncryptor->FreeBuffer(m_pDataReturnedFromDecrypt);
+	}
+	m_pDataReturnedFromDecrypt = NULL;
+}
+
+LPVOID CRecieveSocket::ReceiveEncryptedData(long lInSize, long &lOutSize)
+{
+	if(m_pEncryptor == NULL)
+	{
+		LogSendRecieveInfo("ReceiveEncryptedData::Encryption not initialized");
+		return NULL;
+	}
+
+	if(m_pDataReturnedFromDecrypt)
+		FreeDecryptedData();
+
+	char *pInput = new char[lInSize];
+
+	UCHAR* pOutput = NULL;
+	
+	if(pInput)
+	{
+		int nOut = 0;
+
+		if(RecieveExactSize(pInput, lInSize))
+		{
+			CStringA csPassword;
+			INT_PTR count = g_Opt.m_csNetworkPasswordArray.GetSize();
+			INT_PTR nIndex;
+			for(int i = -2; i < count; i++)
+			{
+				csPassword.Empty();
+				nIndex = i;
+
+				//First time through try the last index that was valid
+				if(i == -2)
+				{
+					nIndex = theApp.m_lLastGoodIndexForNextworkPassword;
+					if(nIndex == -2)
+						continue;
+				}
+
+				if(nIndex == -1)
+				{
+					csPassword = g_Opt.m_csPassword;
+				}
+				else
+				{
+					if(nIndex >= 0 && nIndex < count)
+					{
+						CTextConvert::ConvertToUTF8(g_Opt.m_csNetworkPasswordArray[nIndex], csPassword);
+					}
+					else
+					{
+						continue;
+					}
+				}
+
+				if(m_pEncryptor->Decrypt((UCHAR*)pInput, lInSize, csPassword, pOutput, nOut) == FALSE)
+				{
+					LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: Failed to Decrypt data password = %s"), g_Opt.m_csPassword));
+				}
+				else
+				{
+					theApp.m_lLastGoodIndexForNextworkPassword = (long)nIndex;
+					break;
+				}
+			}
+		}
+		else
+		{
+			LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: FAILED"), lInSize));
+		}
+
+		lOutSize = nOut;
+
+		delete [] pInput;
+		pInput = NULL;
+	}	
+	else
+	{
+		ASSERT(FALSE);
+		LogSendRecieveInfo(StrF(_T("ReceiveEncryptedData:: Failed to create new data size = %d"), lInSize));
+	}
+
+	m_pDataReturnedFromDecrypt = pOutput;
+
+	return pOutput;
+}
+
 int recv_to(int fd, char *buffer, int len, int flags, int to) 
 {
 	fd_set readset;
@@ -154,109 +154,109 @@ int recv_to(int fd, char *buffer, int len, int flags, int to)
 		return result;
 	}
 	return -2;
-}
-
-BOOL CRecieveSocket::RecieveExactSize(char *pData, long lSize)
-{
-	LogSendRecieveInfo(StrF(_T("RecieveExactSize:: ------ Start wanted size %d"), lSize));
-
-	long lReceiveCount = 0;
-
-	long lWanted = lSize;
-	long lOffset = 0;
-	CString originalText = _T("");
-
-	while(lWanted > 0)
-	{		
+}
+
+BOOL CRecieveSocket::RecieveExactSize(char *pData, long lSize)
+{
+	LogSendRecieveInfo(StrF(_T("RecieveExactSize:: ------ Start wanted size %d"), lSize));
+
+	long lReceiveCount = 0;
+
+	long lWanted = lSize;
+	long lOffset = 0;
+	CString originalText = _T("");
+
+	while(lWanted > 0)
+	{		
 		fd_set readset;
 		int res;
 
 		int timeoutMs = CGetSetOptions::GetNetworkReadTimeoutMS();
 		int loops100msEach = (timeoutMs/100);
 
-		for(int i = 0; i < loops100msEach; i++)
-		{
-			lReceiveCount = recv_to(m_Sock, pData + lOffset, lWanted, 0, 100);
-
-			if(lReceiveCount >= 0)
-			{
-				break;
-			}
-			else if(lReceiveCount == SOCKET_ERROR)
-			{
-				ASSERT(FALSE);
-				LogSendRecieveInfo(StrF(_T("RecieveExactSize:: Socket Error")));
-				return FALSE;
-			}
-
-			if(lReceiveCount == -2 && i > 15)
-			{
-				if(m_pProgress != NULL)
-				{
-					originalText = m_pProgress->GetMessage();
-					m_pProgress->SetMessage(StrF(_T("Requesting data from Server")));					
-					m_pProgress->PumpMessages();
-					if(m_pProgress->Cancelled())
-					{
-						return FALSE;
-					}
-				}
-			}
-		}
-
-		if(lReceiveCount == -2)
-		{
-			ASSERT(FALSE);
-			LogSendRecieveInfo(StrF(_T("RecieveExactSize:: Timeout waiting for server")));
-			return FALSE;
-		}
-
-		if(lReceiveCount == SOCKET_ERROR)
-		{
-			LogSendRecieveInfo("RecieveExactSize:: ********ERROR if(lReceiveCount == SOCKET_ERROR)*******");
-			return FALSE;
-		}
-		else if(lReceiveCount == 0)
-		{
-			LogSendRecieveInfo("RecieveExactSize:: ********ERROR lRecieveCount == 0");
-			return FALSE;
-		}
-
-		if(m_pProgress != NULL &&
-			originalText != _T(""))
-		{
-			m_pProgress->SetMessage(originalText);					
-		}
-
-		lWanted -= lReceiveCount;
-		lOffset += lReceiveCount;
-
-		LogSendRecieveInfo(StrF(_T("RecieveExactSize:: ------Bytes Read %d Total Recieved %d"), lReceiveCount, lOffset));
-	}
-
-//	LogSendRecieveInfo(StrF(_T("RecieveExactSize:: ------END RecieveExactSize Recieved %d"), lOffset));
-
-	return TRUE;
-}
-
-#define ENCRYPTED_SIZE_CSENDINFO 508
-
-BOOL CRecieveSocket::RecieveCSendInfo(CSendInfo *pInfo)
-{
-	BOOL bRet = FALSE;
-	long lOutSize = 0;
-
-	long lRecieveSize = ENCRYPTED_SIZE_CSENDINFO;
-
-	LPVOID lpData = ReceiveEncryptedData(lRecieveSize, lOutSize);
-	if(lpData)
-	{
-		memcpy(pInfo, lpData, sizeof(CSendInfo));
-
-		bRet = (pInfo->m_nSize == sizeof(CSendInfo));
-
-		FreeDecryptedData();
-	}
-
-	return bRet;
+		for(int i = 0; i < loops100msEach; i++)
+		{
+			lReceiveCount = recv_to(m_Sock, pData + lOffset, lWanted, 0, 100);
+
+			if(lReceiveCount >= 0)
+			{
+				break;
+			}
+			else if(lReceiveCount == SOCKET_ERROR)
+			{
+				ASSERT(FALSE);
+				LogSendRecieveInfo(StrF(_T("RecieveExactSize:: Socket Error")));
+				return FALSE;
+			}
+
+			if(lReceiveCount == -2 && i > 15)
+			{
+				if(m_pProgress != NULL)
+				{
+					originalText = m_pProgress->GetMessage();
+					m_pProgress->SetMessage(StrF(_T("Requesting data from Server")));					
+					m_pProgress->PumpMessages();
+					if(m_pProgress->Cancelled())
+					{
+						return FALSE;
+					}
+				}
+			}
+		}
+
+		if(lReceiveCount == -2)
+		{
+			ASSERT(FALSE);
+			LogSendRecieveInfo(StrF(_T("RecieveExactSize:: Timeout waiting for server")));
+			return FALSE;
+		}
+
+		if(lReceiveCount == SOCKET_ERROR)
+		{
+			LogSendRecieveInfo("RecieveExactSize:: ********ERROR if(lReceiveCount == SOCKET_ERROR)*******");
+			return FALSE;
+		}
+		else if(lReceiveCount == 0)
+		{
+			LogSendRecieveInfo("RecieveExactSize:: ********ERROR lRecieveCount == 0");
+			return FALSE;
+		}
+
+		if(m_pProgress != NULL &&
+			originalText != _T(""))
+		{
+			m_pProgress->SetMessage(originalText);					
+		}
+
+		lWanted -= lReceiveCount;
+		lOffset += lReceiveCount;
+
+		LogSendRecieveInfo(StrF(_T("RecieveExactSize:: ------Bytes Read %d Total Recieved %d"), lReceiveCount, lOffset));
+	}
+
+//	LogSendRecieveInfo(StrF(_T("RecieveExactSize:: ------END RecieveExactSize Recieved %d"), lOffset));
+
+	return TRUE;
+}
+
+#define ENCRYPTED_SIZE_CSENDINFO 508
+
+BOOL CRecieveSocket::RecieveCSendInfo(CSendInfo *pInfo)
+{
+	BOOL bRet = FALSE;
+	long lOutSize = 0;
+
+	long lRecieveSize = ENCRYPTED_SIZE_CSENDINFO;
+
+	LPVOID lpData = ReceiveEncryptedData(lRecieveSize, lOutSize);
+	if(lpData)
+	{
+		memcpy(pInfo, lpData, sizeof(CSendInfo));
+
+		bRet = (pInfo->m_nSize == sizeof(CSendInfo));
+
+		FreeDecryptedData();
+	}
+
+	return bRet;
 }

+ 1 - 1
RegExFilterHelper.cpp

@@ -31,7 +31,7 @@ bool CRegExFilterData::MatchesProcessFilters(CString &activeApp)
 		return true;
 	}
 
-	int count = m_parsedProcessFilters.GetCount();
+	int count = (int)m_parsedProcessFilters.GetCount();
 
 	if (count == 0)
 	{

+ 3 - 3
SymbolEdit.cpp

@@ -188,7 +188,7 @@ CString CSymbolEdit::SavePastSearches()
 	TiXmlElement* outer = new TiXmlElement("PastSearches");
 	doc.LinkEndChild(outer);
 
-	int count = m_searches.GetCount();
+	int count = (int)m_searches.GetCount();
 	for (int i = 0; i < count; i++)
 	{		
 		TiXmlElement* searchElement = new TiXmlElement("Search");
@@ -246,7 +246,7 @@ void CSymbolEdit::AddToSearchHistory()
 		}
 
 		bool existing = false;
-		int count = m_searches.GetCount();
+		int count = (int)m_searches.GetCount();
 		for (int i = 0; i < count; i++)
 		{
 			if (m_searches[i] == cs)
@@ -275,7 +275,7 @@ bool CSymbolEdit::ShowSearchHistoryMenu()
 	CMenu cmPopUp;
 	cmPopUp.CreatePopupMenu();
 
-	int count = min(m_searches.GetCount(), LIST_MAX_COUNT);
+	int count = min((int)m_searches.GetCount(), LIST_MAX_COUNT);
 	for (int i = count-1; i >= 0; i--)
 	{
 		CString text = m_searches[i];

+ 4 - 4
SystemTray.cpp

@@ -149,9 +149,9 @@ void CSystemTray::Initialise()
 	m_bSingleClickSelect = FALSE;
 
 #ifdef SYSTEMTRAY_USEW2K
-    OSVERSIONINFO os = { sizeof(os) };
-    GetVersionEx(&os);
-    m_bWin2K = ( VER_PLATFORM_WIN32_NT == os.dwPlatformId && os.dwMajorVersion >= 5 );
+    //OSVERSIONINFOW os = { sizeof(os) };
+	//GetVersionExW(&os);
+	m_bWin2K = true;// (VER_PLATFORM_WIN32_NT == os.dwPlatformId && os.dwMajorVersion >= 5);
 #else
     m_bWin2K = FALSE;
 #endif
@@ -189,7 +189,7 @@ BOOL CSystemTray::Create(CWnd* pParent, UINT uCallbackMessage, LPCTSTR szToolTip
     m_bEnabled = TRUE;
 #else
     // this is only for Windows 95 (or higher)
-    m_bEnabled = (GetVersion() & 0xff) >= 4;
+	m_bEnabled = true;// (GetVersion() & 0xff) >= 4;
     if (!m_bEnabled) 
     {
         ASSERT(FALSE);