X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5bd3a2da9573f270564cd035e0cfbf6902cf8750..4fcd60c72f6b90f5063f7000ff5a80a9004055a3:/src/msw/dde.cpp?ds=inline diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index 0d084650d7..6a7e4d547c 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -37,6 +37,8 @@ #include "wx/module.h" #include "wx/dde.h" +#include "wx/intl.h" + #include "wx/msw/private.h" @@ -48,6 +50,24 @@ #include "wx/msw/gnuwin32/extra.h" #endif +// some compilers headers don't define this one (mingw32) +#ifndef DMLERR_NO_ERROR + #define DMLERR_NO_ERROR (0) + + // this one is also missing from some mingw32 headers, but there is no way + // to test for it (I know of) - the test for DMLERR_NO_ERROR works for me, + // but is surely not the right thing to do + extern "C" + HDDEDATA STDCALL DdeClientTransaction(LPBYTE pData, + DWORD cbData, + HCONV hConv, + HSZ hszItem, + UINT wFmt, + UINT wType, + DWORD dwTimeout, + LPDWORD pdwResult); +#endif // no DMLERR_NO_ERROR + // ---------------------------------------------------------------------------- // macros and constants // ---------------------------------------------------------------------------- @@ -378,8 +398,7 @@ wxConnectionBase *wxDDEClient::MakeConnection(const wxString& WXUNUSED(host), (PCONVCONTEXT)NULL); if ( !hConv ) { - DDELogError(wxString::Format(_("Failed to create connection to " - "server '%s' on topic '%s'"), + DDELogError(wxString::Format(_("Failed to create connection to server '%s' on topic '%s'"), server.c_str(), topic.c_str())); } else @@ -511,6 +530,7 @@ bool wxDDEConnection::Execute(const wxChar *data, int size, wxIPCFormat format) XTYP_EXECUTE, DDE_TIMEOUT, &result) != 0; + if ( !ok ) { DDELogError(_T("DDE execute request failed")); @@ -741,7 +761,7 @@ _DDECallback(WORD wType, if (data) { if (user_size < 0) - user_size = wxStrlen(data) + 1; + user_size = wxStrlen((wxChar*)data) + 1; HDDEDATA handle = DdeCreateDataHandle(DDEIdInst, (LPBYTE)data, @@ -772,7 +792,7 @@ _DDECallback(WORD wType, connection->OnPoke(connection->m_topicName, item_name, - connection->m_bufPtr, + (wxChar*)connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt); @@ -898,7 +918,7 @@ static HSZ DDEAtomFromString(const wxString& s) { wxASSERT_MSG( DDEIdInst, _T("DDE not initialized") ); - HSZ hsz = DdeCreateStringHandle(DDEIdInst, s, DDE_CP); + HSZ hsz = DdeCreateStringHandle(DDEIdInst, (wxChar*) s.c_str(), DDE_CP); if ( !hsz ) { DDELogError(_("Failed to create DDE string")); @@ -952,10 +972,10 @@ static wxString DDEGetErrorMsg(UINT error) err = _("a request for a synchronous data transaction has timed out."); break; case DMLERR_DLL_NOT_INITIALIZED: - err = _("a DDEML function was called without first calling the DdeInitialize function,\n\ror an invalid instance identifier\n\rwas passed to a DDEML function."); + err = _("a DDEML function was called without first calling the DdeInitialize function,\nor an invalid instance identifier\nwas passed to a DDEML function."); break; case DMLERR_DLL_USAGE: - err = _("an application initialized as APPCLASS_MONITOR has\n\rattempted to perform a DDE transaction,\n\ror an application initialized as APPCMD_CLIENTONLY has \n\rattempted to perform server transactions."); + err = _("an application initialized as APPCLASS_MONITOR has\nattempted to perform a DDE transaction,\nor an application initialized as APPCMD_CLIENTONLY has \nattempted to perform server transactions."); break; case DMLERR_EXECACKTIMEOUT: err = _("a request for a synchronous execute transaction has timed out."); @@ -985,7 +1005,7 @@ static wxString DDEGetErrorMsg(UINT error) err = _("reentrancy problem."); break; case DMLERR_SERVER_DIED: - err = _("a server-side transaction was attempted on a conversation\n\rthat was terminated by the client, or the server\n\rterminated before completing a transaction."); + err = _("a server-side transaction was attempted on a conversation\nthat was terminated by the client, or the server\nterminated before completing a transaction."); break; case DMLERR_SYS_ERROR: err = _("an internal error has occurred in the DDEML."); @@ -994,7 +1014,7 @@ static wxString DDEGetErrorMsg(UINT error) err = _("a request to end an advise transaction has timed out."); break; case DMLERR_UNFOUND_QUEUE_ID: - err = _("an invalid transaction identifier was passed to a DDEML function.\n\rOnce the application has returned from an XTYP_XACT_COMPLETE callback,\n\rthe transaction identifier for that callback is no longer valid."); + err = _("an invalid transaction identifier was passed to a DDEML function.\nOnce the application has returned from an XTYP_XACT_COMPLETE callback,\nthe transaction identifier for that callback is no longer valid."); break; default: err.Printf(_("Unknown DDE error %08x"), error);