Windows: fix checked UNICODE build of talocale
[openafs.git] / src / WINNT / talocale / tal_dialog.cpp
index b5caa3c..363ae2e 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ * 
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
 
 extern "C" {
 #include <afs/param.h>
@@ -44,13 +52,13 @@ HWND ModelessDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM
 }
 
 
-int ModalDialog (int idd, HWND hWndParent, DLGPROC lpDialogFunc)
+INT_PTR ModalDialog (int idd, HWND hWndParent, DLGPROC lpDialogFunc)
 {
    return ModalDialogParam (idd, hWndParent, lpDialogFunc, 0);
 }
 
 
-int ModalDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
+INT_PTR ModalDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
 {
    HINSTANCE hInstFound;
    LPCDLGTEMPLATE pTemplate;
@@ -68,34 +76,34 @@ int ModalDialogParam (int idd, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwI
 int cdecl Message (UINT type, LPCTSTR title, LPCTSTR text, LPCTSTR fmt, ...)
 {
    va_list  arg;
-   if (fmt != NULL)
+   // if (fmt != NULL)
       va_start (arg, fmt);
-   return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
+   return vMessage (type, PtrToLong(title), PtrToLong(text), fmt, arg);
 }
 
 
 int cdecl Message (UINT type, LPCTSTR title, int text, LPCTSTR fmt, ...)
 {
    va_list  arg;
-   if (fmt != NULL)
+   // if (fmt != NULL)
       va_start (arg, fmt);
-   return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
+   return vMessage (type, PtrToLong(title), (LONG)text, fmt, arg);
 }
 
 
 int cdecl Message (UINT type, int title, LPCTSTR text, LPCTSTR fmt, ...)
 {
    va_list  arg;
-   if (fmt != NULL)
+   // if (fmt != NULL)
       va_start (arg, fmt);
-   return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
+   return vMessage (type, (LONG)title, PtrToLong(text), fmt, arg);
 }
 
 
 int cdecl Message (UINT type, int title, int text, LPCTSTR fmt, ...)
 {
    va_list  arg;
-   if (fmt != NULL)
+   // if (fmt != NULL)
       va_start (arg, fmt);
    return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
 }
@@ -103,19 +111,19 @@ int cdecl Message (UINT type, int title, int text, LPCTSTR fmt, ...)
 
 int cdecl vMessage (UINT type, LPCTSTR title, LPCTSTR text, LPCTSTR fmt, va_list arg)
 {
-   return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
+   return vMessage (type, PtrToLong(title), PtrToLong(text), fmt, arg);
 }
 
 
 int cdecl vMessage (UINT type, LPCTSTR title, int text, LPCTSTR fmt, va_list arg)
 {
-   return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
+   return vMessage (type, PtrToLong(title), (LONG)text, fmt, arg);
 }
 
 
 int cdecl vMessage (UINT type, int title, LPCTSTR text, LPCTSTR fmt, va_list arg)
 {
-   return vMessage (type, (LONG)title, (LONG)text, fmt, arg);
+   return vMessage (type, (LONG)title, PtrToLong(text), fmt, arg);
 }