X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0a0e6a5bafe2efb3466b1527eb7eb670aaa5e634..d35dce3a2e3ca417093eaa192f1e9e54e55a22ba:/src/msw/ole/automtn.cpp?ds=sidebyside diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index e559ff9d0a..1224bc0627 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -31,8 +31,7 @@ #include "wx/msw/private.h" #include "wx/msw/ole/oleutils.h" #include "wx/msw/ole/automtn.h" - -#include +#include "wx/math.h" #ifdef __WXWINCE__ #include "wx/msw/wince/time.h" @@ -200,7 +199,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action, excep.pfnDeferredFillIn = NULL; hr = ((IDispatch*)m_dispatchPtr)->Invoke(dispIds[0], IID_NULL, LOCALE_SYSTEM_DEFAULT, - action, &dispparams, vReturnPtr, &excep, &uiArgErr); + (WORD)action, &dispparams, vReturnPtr, &excep, &uiArgErr); for (i = 0; i < namedArgStringCount; i++) { @@ -611,35 +610,13 @@ bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) oleVariant.vt = VT_BSTR; oleVariant.bstrVal = wxConvertStringToOle(str); } -// For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled -// Now obsolete -#if 0 // wxUSE_TIMEDATE && !defined(__WATCOMC__) - else if (type == wxT("date")) - { - wxDate date( variant.GetDate() ); - oleVariant.vt = VT_DATE; - - if (!OleDateFromTm(date.GetYear(), date.GetMonth(), date.GetDay(), - 0, 0, 0, oleVariant.date)) - return false; - } - else if (type == wxT("time")) - { - wxTime time( variant.GetTime() ); - oleVariant.vt = VT_DATE; - - if (!OleDateFromTm(time.GetYear(), time.GetMonth(), time.GetDay(), - time.GetHour(), time.GetMinute(), time.GetSecond(), oleVariant.date)) - return false; - } -#endif #if wxUSE_DATETIME else if (type == wxT("datetime")) { wxDateTime date( variant.GetDateTime() ); oleVariant.vt = VT_DATE; - if (!OleDateFromTm(date.GetYear(), date.GetMonth(), date.GetDay(), + if (!OleDateFromTm((WORD)date.GetYear(), date.GetMonth(), date.GetDay(), date.GetHour(), date.GetMinute(), date.GetSecond(), oleVariant.date)) return false; } @@ -724,7 +701,12 @@ bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) if (!TmFromOleDate(oleVariant.date, tmTemp)) return false; - wxDateTime date(tmTemp.tm_yday, (wxDateTime::Month) tmTemp.tm_mon, tmTemp.tm_year, tmTemp.tm_hour, tmTemp.tm_min, tmTemp.tm_sec); + wxDateTime date((wxDateTime::wxDateTime_t) tmTemp.tm_yday, + (wxDateTime::Month) tmTemp.tm_mon, + tmTemp.tm_year, + (wxDateTime::wxDateTime_t) tmTemp.tm_hour, + (wxDateTime::wxDateTime_t) tmTemp.tm_min, + (wxDateTime::wxDateTime_t) tmTemp.tm_sec); variant = date; #endif @@ -1130,7 +1112,7 @@ static void ReleaseVariant(VARIANTARG *pvarg) VARIANTARG _huge *pvargArray; long lLBound, lUBound, l; - vt = pvarg->vt & 0xfff; // mask off flags + vt = (VARTYPE)(pvarg->vt & 0xfff); // mask off flags // check if an array. If so, free its contents, then the array itself. if (V_ISARRAY(pvarg))