Author: cfinck
Date: Fri May 9 08:33:12 2008
New Revision: 33396
URL:
http://svn.reactos.org/svn/reactos?rev=33396&view=rev
Log:
Convert the remaining ANSI-only stuff to TCHAR
Modified:
trunk/reactos/base/applications/calc/calc.h
trunk/reactos/base/applications/calc/winmain.c
Modified: trunk/reactos/base/applications/calc/calc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/cal…
==============================================================================
--- trunk/reactos/base/applications/calc/calc.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/calc/calc.h [iso-8859-1] Fri May 9 08:33:12 2008
@@ -29,6 +29,12 @@
#ifndef IDC_STATIC
#define IDC_STATIC ((DWORD)-1)
+#endif
+
+#ifdef UNICODE
+#define CF_TCHAR CF_UNICODETEXT
+#else
+#define CF_TCHAR CF_TEXT
#endif
#define CALC_VERSION TEXT("1.06")
@@ -137,8 +143,8 @@
DWORD degr;
DWORD action;
HWND hStatWnd;
- char *Clipboard;
- char *ClipPtr;
+ TCHAR *Clipboard;
+ TCHAR *ClipPtr;
unsigned int last_operator;
unsigned int prev_operator;
TCHAR sDecimal[8];
Modified: trunk/reactos/base/applications/calc/winmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/calc/win…
==============================================================================
--- trunk/reactos/base/applications/calc/winmain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/calc/winmain.c [iso-8859-1] Fri May 9 08:33:12 2008
@@ -854,11 +854,8 @@
buffer = (TCHAR *)GlobalLock(clipbuffer);
_tcscpy(buffer, ptr);
GlobalUnlock(clipbuffer);
-#ifdef UNICODE
- SetClipboardData(CF_UNICODETEXT,clipbuffer);
-#else
- SetClipboardData(CF_TEXT,clipbuffer);
-#endif
+
+ SetClipboardData(CF_TCHAR, clipbuffer);
CloseClipboard();
}
}
@@ -868,23 +865,23 @@
TCHAR display[sizeof(calc.buffer)];
SendDlgItemMessage(hWnd, IDC_TEXT_OUTPUT, WM_GETTEXT, (WPARAM)SIZEOF(display),
(LPARAM)display);
- if (calc.base == IDC_RADIO_DEC && strchr(calc.buffer, '.') == NULL)
+ if (calc.base == IDC_RADIO_DEC && _tcschr(calc.buffer, '.') == NULL)
display[_tcslen(display)-calc.sDecimal_len] = TEXT('\0');
CopyMemToClipboard(display);
}
-static char *ReadClipboard(void)
-{
- char *buffer = NULL;
+static TCHAR *ReadClipboard(void)
+{
+ TCHAR *buffer = NULL;
if (OpenClipboard(NULL)) {
- HANDLE hData = GetClipboardData(CF_TEXT);
- char *fromClipboard;
+ HANDLE hData = GetClipboardData(CF_TCHAR);
+ TCHAR *fromClipboard;
if (hData != NULL) {
- fromClipboard = (char *)GlobalLock(hData);
- if (strlen(fromClipboard))
- buffer = _strupr(_strdup(fromClipboard));
+ fromClipboard = (TCHAR *)GlobalLock(hData);
+ if (_tcslen(fromClipboard))
+ buffer = _tcsupr(_tcsdup(fromClipboard));
GlobalUnlock( hData );
}
CloseClipboard();
@@ -894,8 +891,9 @@
static void handle_clipboard_input(HWND hwnd)
{
- char *ptr = calc.ClipPtr;
- int ch, x;
+ TCHAR *ptr = calc.ClipPtr;
+ TCHAR ch;
+ INT x;
ch = *ptr++;
if (ch == '\\')
@@ -1522,7 +1520,7 @@
EnableMenuItem(GetSubMenu(GetMenu(hWnd), 0),
IDM_EDIT_PASTE,
MF_BYCOMMAND|
- (IsClipboardFormatAvailable(CF_TEXT) ?
+ (IsClipboardFormatAvailable(CF_TCHAR) ?
MF_ENABLED : MF_GRAYED));
break;
case WM_EXITMENULOOP: