Subject: | doesn't work with UNICODE=1, fixes for wx2.6 (wxLogTrace) |
It has already been posted to the wx-perl list, but I'm attaching the patch to Wx::ActiveX to get it to compile with the UNICODE=1 flags enabled.
I tried to build it this morning against wxWidgets 2.6.1 and got a few
error: no matching function for call to `wxLogTrace(const wchar_t[20])'
errors from activex/wxactivex.cpp. I fixed, by removing the tracing calls. It's not ideal, but they're only informational and there's only a few.
This patch may help others build Wx::ActiveX against new versions of wxWidgets.
--simonflk
206c206
< hmodule = LoadLibrary("OLE");
---
> hmodule = LoadLibrary(_T("OLE"));
315c315
< CallMethod("GoHome");
---
> CallMethod(_T("GoHome"));
411c411
< return "";
---
> return _T("");
421c421
< return "";
---
> return _T("");
432c432
< return "";
---
> return _T("");
438c438
< return "";
---
> return _T("");
445c445
< return "";
---
> return _T("");
451c451
< return "";
---
> return _T("");
463c463
< return "";
---
> return _T("");
269,292c269,292
< VT(VT_SAFEARRAY, "SafeArray");
< VT(VT_EMPTY, "empty");
< VT(VT_NULL, "null");
< VT(VT_UI1, "byte");
< VT(VT_I1, "char");
< VT(VT_I2, "short");
< VT(VT_I4, "long");
< VT(VT_UI2, "unsigned short");
< VT(VT_UI4, "unsigned long");
< VT(VT_INT, "int");
< VT(VT_UINT, "unsigned int");
< VT(VT_R4, "real(4)");
< VT(VT_R8, "real(8)");
< VT(VT_CY, "Currency");
< VT(VT_DATE, "wxDate");
< VT(VT_BSTR, "wxString");
< VT(VT_DISPATCH, "IDispatch");
< VT(VT_ERROR, "SCode Error");
< VT(VT_BOOL, "bool");
< VT(VT_VARIANT, "wxVariant");
< VT(VT_UNKNOWN, "IUknown");
< VT(VT_VOID, "void");
< VT(VT_PTR, "void *");
< VT(VT_USERDEFINED, "*user defined*");
---
> VT(VT_SAFEARRAY, _T("SafeArray"));
> VT(VT_EMPTY, _T("empty"));
> VT(VT_NULL, _T("null"));
> VT(VT_UI1, _T("byte"));
> VT(VT_I1, _T("char"));
> VT(VT_I2, _T("short"));
> VT(VT_I4, _T("long"));
> VT(VT_UI2, _T("unsigned short"));
> VT(VT_UI4, _T("unsigned long"));
> VT(VT_INT, _T("int"));
> VT(VT_UINT, _T("unsigned int"));
> VT(VT_R4, _T("real(4)"));
> VT(VT_R8, _T("real(8)"));
> VT(VT_CY, _T("Currency"));
> VT(VT_DATE, _T("wxDate"));
> VT(VT_BSTR, _T("wxString"));
> VT(VT_DISPATCH, _T("IDispatch"));
> VT(VT_ERROR, _T("SCode Error"));
> VT(VT_BOOL, _T("bool"));
> VT(VT_VARIANT, _T("wxVariant"));
> VT(VT_UNKNOWN, _T("IUknown"));
> VT(VT_VOID, _T("void"));
> VT(VT_PTR, _T("void *"));
> VT(VT_USERDEFINED, _T("*user defined*"));
297c297
< s << "Unknown(" << vt << ")";
---
> s << _T("Unknown(") << vt << _T(")");
1055,1056c1055,1056
< wxString err = "wxActiveXEvent::operator[] invalid name <" + name + ">";
< err += "\r\nValid Names = :\r\n";
---
> wxString err = _T("wxActiveXEvent::operator[] invalid name <") + name + _T(">");
> err += _T("\r\nValid Names = :\r\n");
1060c1060
< err += "\r\n";
---
> err += _T("\r\n");
1289c1289
< wxString tmp = "" ;
---
> wxString tmp = _T("") ;
1298c1298
< wxString tmp = "" ;
---
> wxString tmp = _T("") ;
1308c1308
< wxString tmp = "" ;
---
> wxString tmp = _T("") ;
1334c1334
< wxString tmp = "" ;
---
> wxString tmp = _T("") ;
1377c1377
< s << "property <" << name << "> not found";
---
> s << _T("property <") << name << _T("> not found");
1406c1406
< s << "method <" << name << "> not found";
---
> s << _T("method <") << name << _T("> not found");
1437c1437
< s << "property <" << name << "> is readonly";
---
> s << _T("property <") << name << _T("> is readonly");
1474c1474
< s << "property <" << name << "> is writeonly";
---
> s << _T("property <") << name << _T("> is writeonly");
1822d1821
< wxLogTrace(wxT("repainting activex win"));
1857d1855
< wxLogTrace(wxT("no oleInPlaceObject"));
1862d1859
< wxLogTrace(wxT("mouse event"));
1905d1901
< wxLogTrace(wxT("no message"));
1911d1906
< wxLogTrace(wxT("msg not delivered"));
1916d1910
< wxLogTrace(wxT("msg sent"));
2643c2637
< char buf[256];
---
> wxChar buf[256];
2664c2658
< return "";
---
> return _T("");
2667c2661
< return "Cannot connect to event interface (maybe not there ?) - see MSDN";
---
> return _T("Cannot connect to event interface (maybe not there ?) - see MSDN");
2670c2664
< return "The requested member does not exist, or the call to Invoke tried to set the value of a read-only property.";
---
> return _T("The requested member does not exist, or the call to Invoke tried to set the value of a read-only property.");
2673c2667
< return "One of the parameters in rgvarg is not a valid variant type.";
---
> return _T("One of the parameters in rgvarg is not a valid variant type.");
2676c2670
< return "The number of elements provided to DISPPARAMS is different from the number of parameters accepted by the method or property";
---
> return _T("The number of elements provided to DISPPARAMS is different from the number of parameters accepted by the method or property");
2679c2673
< return "The application needs to raise an exception. In this case, the structure passed in pExcepInfo should be filled in.";
---
> return _T("The application needs to raise an exception. In this case, the structure passed in pExcepInfo should be filled in.");
2682c2676
< return "One or more of the parameters could not be coerced. The index within rgvarg of the first parameter with the incorrect type is returned in the puArgErr parameter.";
---
> return _T("One or more of the parameters could not be coerced. The index within rgvarg of the first parameter with the incorrect type is returned in the puArgErr parameter.");
2685c2679
< return "A required parameter was omitted.";
---
> return _T("A required parameter was omitted.");
2688c2682
< return "One of the parameter DISPIDs does not correspond to a parameter on the method. In this case, puArgErr should be set to the first parameter that contains the error.";
---
> return _T("One of the parameter DISPIDs does not correspond to a parameter on the method. In this case, puArgErr should be set to the first parameter that contains the error.");
2691c2685
< return "The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.";
---
> return _T("The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.");
2694c2688
< return "The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.";
---
> return _T("The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.");
2697c2691
< return "The command identified by nCmdID is currently disabled and cannot be executed.";
---
> return _T("The command identified by nCmdID is currently disabled and cannot be executed.");
2700c2694
< return "The caller has asked for help on the command identified by nCmdID, but no help is available.";
---
> return _T("The caller has asked for help on the command identified by nCmdID, but no help is available.");
2703c2697
< return "The user canceled the execution of the command.";
---
> return _T("The user canceled the execution of the command.");
2706c2700
< return "E_INVALIDARG";
---
> return _T("E_INVALIDARG");
2709c2703
< return "E_OUTOFMEMORY";
---
> return _T("E_OUTOFMEMORY");
2712c2706
< return "E_NOINTERFACE";
---
> return _T("E_NOINTERFACE");
2715c2709
< return "E_UNEXPECTED";
---
> return _T("E_UNEXPECTED");
2718c2712
< return "STG_E_INVALIDFLAG";
---
> return _T("STG_E_INVALIDFLAG");
2721c2715
< return "E_FAIL";
---
> return _T("E_FAIL");
2724c2718
< return "E_NOTIMPL";
---
> return _T("E_NOTIMPL");
2728,2730c2722
< char buf[64];
< sprintf(buf, "Unknown - 0x%X", hr);
< return wxString(buf);
---
> return wxString::Format(_T("Unknown - 0x%X"), hr);
2864c2856
< return "StringFromIID() error";
---
> return _T("StringFromIID() error");