]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/automtn.cpp
added TODO list for cross compilation
[wxWidgets.git] / src / msw / ole / automtn.cpp
index f72ecea359d7aded0b2b75b2dbdd82ff617d518e..f8bac3d40085236332d47d5a5049e6de8fa268da 100644 (file)
 #endif
 
 #include "wx/log.h"
-#include "wx/msw/ole/automtn.h"
 
-#include <windows.h>
-#include <ole2ver.h>
-#include <oleauto.h>
 #include <math.h>
 #include <time.h>
 
-#ifdef GetObject
-#undef GetObject
-#endif
+#include "wx/msw/ole/automtn.h"
+
+#include "wx/msw/private.h"
+
+#include <ole2ver.h>
+#include <oleauto.h>
 
 // wrapper around BSTR type (by Vadim Zeitlin)
 
@@ -81,9 +80,6 @@ static int rgMonthDays[13] =
 static BOOL OleDateFromTm(WORD wYear, WORD wMonth, WORD wDay,
        WORD wHour, WORD wMinute, WORD wSecond, DATE& dtDest);
 static BOOL TmFromOleDate(DATE dtSrc, struct tm& tmDest);
-static void TmConvertToStandardFormat(struct tm& tmSrc);
-static double DoubleFromDate(DATE dt);
-static DATE DateFromDouble(double dbl);
 
 static void ClearVariant(VARIANTARG *pvarg) ;
 static void ReleaseVariant(VARIANTARG *pvarg) ;
@@ -494,7 +490,6 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const
                return FALSE;
 
        CLSID clsId;
-       IUnknown * pUnk = NULL;
 
        BasicString unicodeName((const char*) classId);
        
@@ -539,7 +534,8 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
     else if (type == "bool")
     {
         oleVariant.vt = VT_BOOL;
-#ifdef __WATCOMC__
+        // 'bool' required for VC++ 4 apparently
+#if defined(__WATCOMC__) || (defined(__VISUALC__) && (__VISUALC__ <= 1000))
         oleVariant.bool = variant.GetBool();
 #else
         oleVariant.boolVal = variant.GetBool();
@@ -667,8 +663,12 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
 
        case VT_BOOL:
                {
-#ifdef __WATCOMC__
+#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000)) //GC
+#ifndef HAVE_BOOL // Can't use bool operator if no native bool type
+                       variant = (long) (oleVariant.bool != 0);
+#else
                        variant = (bool) (oleVariant.bool != 0);
+#endif
 #else
                        variant = (bool) (oleVariant.boolVal != 0);
 #endif
@@ -749,7 +749,7 @@ static wxString ConvertStringFromOle(BSTR bStr)
 {
        int len = SysStringLen(bStr) + 1;
        char    *buf = new char[len];
-       int i = wcstombs( buf, bStr, len);
+       (void)wcstombs( buf, bStr, len);
 
        wxString str(buf);
        delete[] buf;
@@ -965,6 +965,8 @@ DoTime:
        return TRUE;
 }
 
+// this function is not used
+#if 0
 void TmConvertToStandardFormat(struct tm& tmSrc)
 {
        // Convert afx internal tm to format expected by runtimes (_tcsftime, etc)
@@ -997,6 +999,7 @@ DATE DateFromDouble(double dbl)
        double temp = floor(dbl); // dbl is now whole part
        return temp + (temp - dbl);
 }
+#endif // 0
 
 /*
  *  ClearVariant