From 49e1a12fa7e48f37b456a93a570bc13322e48fc5 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Thu, 8 Oct 2009 11:49:12 +0000 Subject: [PATCH] [Bugfix] Fix MS Visual Studio 2008 compilation issues. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_0@3912 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- win/rfb_win32/CKeyboard.cxx | 2 +- win/vncconfig/vncconfig.rc | 8 ++++++-- win/vncviewer/DesktopWindow.cxx | 2 +- win/vncviewer/OptionsDialog.cxx | 8 ++++---- win/vncviewer/ViewerToolBar.cxx | 20 ++++++++++---------- win/vncviewer/vncviewer.rc | 8 ++++++-- win/winvnc/ControlPanel.cxx | 8 ++++---- win/winvnc/winvnc.rc | 4 ++-- win/wm_hooks/wm_hooks.rc | 4 ++-- 9 files changed, 36 insertions(+), 28 deletions(-) diff --git a/win/rfb_win32/CKeyboard.cxx b/win/rfb_win32/CKeyboard.cxx index 08e25dc4..f2cda7e2 100644 --- a/win/rfb_win32/CKeyboard.cxx +++ b/win/rfb_win32/CKeyboard.cxx @@ -64,7 +64,7 @@ public: // be a comma and a DECIMAL to be a dot. if (extendedVkey == VK_DECIMAL || extendedVkey == VK_SEPARATOR) { char buf[4]; - if (!GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buf, sizeof(buf))) { + if (!GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, (LPSTR) buf, sizeof(buf))) { vlog.debug("failed to retrieve LOCALE_SDECIMAL"); } else { switch (buf[0]) { diff --git a/win/vncconfig/vncconfig.rc b/win/vncconfig/vncconfig.rc index f39256c4..308865a2 100644 --- a/win/vncconfig/vncconfig.rc +++ b/win/vncconfig/vncconfig.rc @@ -7,7 +7,11 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "windows.h" + +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +38,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include ""windows.h""\r\n" "\0" END diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx index 744149da..49b6c3fa 100644 --- a/win/vncviewer/DesktopWindow.cxx +++ b/win/vncviewer/DesktopWindow.cxx @@ -75,7 +75,7 @@ LRESULT CALLBACK DesktopWindowProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa try { result = _this->processMessage(msg, wParam, lParam); } catch (rfb::UnsupportedPixelFormatException &e) { - MsgBox(0, e.str(), MB_OK | MB_ICONINFORMATION); + MsgBox(0, (TCHAR *) e.str(), MB_OK | MB_ICONINFORMATION); _this->getCallback()->closeWindow(); } catch (rdr::Exception& e) { vlog.error("untrapped: %s", e.str()); diff --git a/win/vncviewer/OptionsDialog.cxx b/win/vncviewer/OptionsDialog.cxx index f8562510..6b4b6448 100644 --- a/win/vncviewer/OptionsDialog.cxx +++ b/win/vncviewer/OptionsDialog.cxx @@ -175,7 +175,7 @@ public: (WPARAM)i, (LPARAM)(int FAR*)scale_values[i]); } if (dlg->options.autoScaling) { - SetDlgItemText(handle, IDC_COMBO_SCALE, "Auto"); + SetDlgItemText(handle, IDC_COMBO_SCALE, (LPCTSTR) "Auto"); } else { SetDlgItemInt(handle, IDC_COMBO_SCALE, dlg->options.scale, FALSE); } @@ -195,8 +195,8 @@ public: dlg->options.autoScaling = false; } else { char scaleStr[20]; - GetDlgItemText(handle, IDC_COMBO_SCALE, scaleStr, 20); - if (strcmp(scaleStr, "Auto") == 0) { + GetDlgItemText(handle, IDC_COMBO_SCALE, (LPTSTR) scaleStr, 20); + if (strcmp(scaleStr, (const char *) "Auto") == 0) { dlg->options.autoScaling = true; } } @@ -212,7 +212,7 @@ public: int index = SendMessage(handleComboScale, CB_GETCURSEL, 0, 0); SendMessage(handleComboScale, CB_GETLBTEXT, (WPARAM)index, (LPARAM)scaleStr); } else { - GetDlgItemText(handle, IDC_COMBO_SCALE, scaleStr, 20); + GetDlgItemText(handle, IDC_COMBO_SCALE, (LPTSTR) scaleStr, 20); } return true; } diff --git a/win/vncviewer/ViewerToolBar.cxx b/win/vncviewer/ViewerToolBar.cxx index 38e84c45..13a64111 100644 --- a/win/vncviewer/ViewerToolBar.cxx +++ b/win/vncviewer/ViewerToolBar.cxx @@ -63,34 +63,34 @@ LRESULT ViewerToolBar::processWM_NOTIFY(WPARAM wParam, LPARAM lParam) { switch (TTStr->hdr.idFrom) { case ID_OPTIONS: - TTStr->lpszText = "Connection options..."; + TTStr->lpszText = (LPTSTR) "Connection options..."; break; case ID_INFO: - TTStr->lpszText = "Connection info"; + TTStr->lpszText = (LPTSTR) "Connection info"; break; case ID_FULLSCREEN: - TTStr->lpszText = "Full screen"; + TTStr->lpszText = (LPTSTR) "Full screen"; break; case ID_REQUEST_REFRESH: - TTStr->lpszText = "Request screen refresh"; + TTStr->lpszText = (LPTSTR) "Request screen refresh"; break; case ID_SEND_CAD: - TTStr->lpszText = "Send Ctrl-Alt-Del"; + TTStr->lpszText = (LPTSTR) "Send Ctrl-Alt-Del"; break; case ID_SEND_CTLESC: - TTStr->lpszText = "Send Ctrl-Esc"; + TTStr->lpszText = (LPTSTR) "Send Ctrl-Esc"; break; case ID_CTRL_KEY: - TTStr->lpszText = "Send Ctrl key press/release"; + TTStr->lpszText = (LPTSTR) "Send Ctrl key press/release"; break; case ID_ALT_KEY: - TTStr->lpszText = "Send Alt key press/release"; + TTStr->lpszText = (LPTSTR) "Send Alt key press/release"; break; case ID_NEW_CONNECTION: - TTStr->lpszText = "New connection..."; + TTStr->lpszText = (LPTSTR) "New connection..."; break; case ID_CONN_SAVE_AS: - TTStr->lpszText = "Save connection info as..."; + TTStr->lpszText = (LPTSTR) "Save connection info as..."; break; default: break; diff --git a/win/vncviewer/vncviewer.rc b/win/vncviewer/vncviewer.rc index b256ffff..58d79e3a 100644 --- a/win/vncviewer/vncviewer.rc +++ b/win/vncviewer/vncviewer.rc @@ -7,7 +7,11 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "windows.h" + +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +38,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include ""windows.h""\r\n" "\0" END diff --git a/win/winvnc/ControlPanel.cxx b/win/winvnc/ControlPanel.cxx index 74282303..59bb511a 100644 --- a/win/winvnc/ControlPanel.cxx +++ b/win/winvnc/ControlPanel.cxx @@ -18,9 +18,9 @@ bool ControlPanel::showDialog() void ControlPanel::initDialog() { TCHAR *ColumnsStrings[] = { - "IP address", - "Time connected", - "Status" + (TCHAR *) "IP address", + (TCHAR *) "Time connected", + (TCHAR *) "Status" }; InitLVColumns(IDC_LIST_CONNECTIONS, handle, 120, 3, ColumnsStrings, LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM, @@ -90,7 +90,7 @@ void ControlPanel::UpdateListView(rfb::ListConnInfo* LCInfo) for (ListConn.iBegin(); !ListConn.iEnd(); ListConn.iNext()) { ListConn.iGetCharInfo(ItemString); - InsertLVItem(IDC_LIST_CONNECTIONS, handle, i, ItemString, 3); + InsertLVItem(IDC_LIST_CONNECTIONS, handle, i, (TCHAR **) ItemString, 3); for (ListSelConn.iBegin(); !ListSelConn.iEnd(); ListSelConn.iNext()) { if (ListSelConn.iGetConn() == ListConn.iGetConn()) SelectLVItem(IDC_LIST_CONNECTIONS, handle, i); diff --git a/win/winvnc/winvnc.rc b/win/winvnc/winvnc.rc index b1104b5b..275f4524 100644 --- a/win/winvnc/winvnc.rc +++ b/win/winvnc/winvnc.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "windows.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include ""windows.h""\r\n" "\0" END diff --git a/win/wm_hooks/wm_hooks.rc b/win/wm_hooks/wm_hooks.rc index 85351926..5a11fd28 100644 --- a/win/wm_hooks/wm_hooks.rc +++ b/win/wm_hooks/wm_hooks.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "windows.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" + "#include ""windows.h""\r\n" "\0" END -- 2.39.5