X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/24f4ad95920746ebc6cfc6f2ab86f65fb53345ca..1b489359c4051c23262e3118b4489054ef7f3843:/src/msw/ole/automtn.cpp diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 44ddb88ab9..3870d96263 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -24,7 +24,7 @@ // Watcom C++ gives a linker error if this is compiled in. // With Borland C++, all samples crash if this is compiled in. -#if wxUSE_OLE &&!defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) +#if wxUSE_OLE &&!defined(__WATCOMC__) && !(defined(__BORLANDC__) && (__BORLANDC__ < 0x520)) && !defined(__CYGWIN10__) && !defined(__WXWINE__) #include "wx/log.h" #include "wx/msw/ole/automtn.h" @@ -588,16 +588,20 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) wxString type(variant.GetType()); - if (type == wxT("char")) - { - oleVariant.vt=VT_I1; // Signed Char - oleVariant.cVal=variant.GetChar(); - } - else if (type == wxT("long")) + + if (type == wxT("long")) { oleVariant.vt = VT_I4; oleVariant.lVal = variant.GetLong() ; } + // cVal not always present +#ifndef __GNUWIN32__ + else if (type == wxT("char")) + { + oleVariant.vt=VT_I1; // Signed Char + oleVariant.cVal=variant.GetChar(); + } +#endif else if (type == wxT("double")) { oleVariant.vt = VT_R8; @@ -829,12 +833,15 @@ static BSTR ConvertStringToOle(const wxString& str) static wxString ConvertStringFromOle(BSTR bStr) { +#if wxUSE_UNICODE + wxString str(bStr); +#else int len = SysStringLen(bStr) + 1; char *buf = new char[len]; (void)wcstombs( buf, bStr, len); - - wxString str(buf); + wxString str(buf); delete[] buf; +#endif return str; }