X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0a8d6945ae4e3cb5b704410d922846226083ea4e..3eabbbcc5d6a3dc2395a48eeed3da4bc894f644b:/src/msw/dde.cpp diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index d59e1256d3..ce2f37211b 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -593,6 +593,10 @@ wxDDEConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) realSize = conv->ToWChar((wchar_t *)realData, realSize, text, len); if ( realSize == wxCONV_FAILED ) return false; + + // We need to pass the size of the buffer to DdeClientTransaction() and + // not the length of the string. + realSize *= sizeof(wchar_t); } #else // !wxUSE_UNICODE if ( format == wxIPC_UNICODETEXT ) @@ -635,7 +639,7 @@ wxDDEConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) DWORD result; bool ok = DdeClientTransaction(realData, - realSize*sizeof(wxChar), + realSize, GetHConv(), NULL, // MSDN: if the transaction specified by @@ -1064,7 +1068,7 @@ static HSZ DDEAtomFromString(const wxString& s) { wxASSERT_MSG( DDEIdInst, wxT("DDE not initialized") ); - HSZ hsz = DdeCreateStringHandle(DDEIdInst, (wxChar*)s.wx_str(), DDE_CP); + HSZ hsz = DdeCreateStringHandle(DDEIdInst, wxMSW_CONV_LPTSTR(s), DDE_CP); if ( !hsz ) { DDELogError(_("Failed to create DDE string"));