[Bugfix] Fix MS Visual Studio 2008 compilation issues.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3912 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/rfb_win32/CKeyboard.cxx b/win/rfb_win32/CKeyboard.cxx
index 08e25dc..f2cda7e 100644
--- a/win/rfb_win32/CKeyboard.cxx
+++ b/win/rfb_win32/CKeyboard.cxx
@@ -64,7 +64,7 @@
// 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 d638100..ff3f91f 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 @@
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 744149d..49b6c3f 100644
--- a/win/vncviewer/DesktopWindow.cxx
+++ b/win/vncviewer/DesktopWindow.cxx
@@ -75,7 +75,7 @@
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 f856251..6b4b644 100644
--- a/win/vncviewer/OptionsDialog.cxx
+++ b/win/vncviewer/OptionsDialog.cxx
@@ -175,7 +175,7 @@
(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 @@
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 @@
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 38e84c4..13a6411 100644
--- a/win/vncviewer/ViewerToolBar.cxx
+++ b/win/vncviewer/ViewerToolBar.cxx
@@ -63,34 +63,34 @@
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 a90c959..64818da 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 @@
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 7428230..59bb511 100644
--- a/win/winvnc/ControlPanel.cxx
+++ b/win/winvnc/ControlPanel.cxx
@@ -18,9 +18,9 @@
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 @@
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 4387629..56ce598 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 @@
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 8535192..5a11fd2 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 @@
2 TEXTINCLUDE DISCARDABLE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#include ""windows.h""\r\n"
"\0"
END