X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/65fd5cb0124e62ab1fc41f93382a205d95b00e75..342751763793b5cdad252d731aac0618d0674e5b:/src/msw/dde.cpp?ds=sidebyside diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index cff1fb1a1a..8986ce0e56 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -54,11 +54,9 @@ #define _EXPORT _export #endif -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxServerBase) IMPLEMENT_DYNAMIC_CLASS(wxDDEClient, wxClientBase) IMPLEMENT_CLASS(wxDDEConnection, wxConnectionBase) -#endif static wxDDEConnection *DDEFindConnection(HCONV hConv); static void DDEDeleteConnection(HCONV hConv); @@ -228,7 +226,7 @@ bool wxDDEServer::Create(const wxString& server_name) wxDDEServer::~wxDDEServer(void) { - if (m_serviceName != _T("")) + if (m_serviceName != wxT("")) { HSZ serviceName = DdeCreateStringHandle(DDEIdInst, WXSTRINGCAST m_serviceName, CP_WINANSI); if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_UNREGISTER) == 0) @@ -441,7 +439,7 @@ bool wxDDEConnection::Disconnect(void) return (DdeDisconnect((HCONV) m_hConv) != 0); } -bool wxDDEConnection::Execute(wxChar *data, int size, wxIPCFormat format) +bool wxDDEConnection::Execute(const wxChar *data, int size, wxIPCFormat format) { DWORD result; if (size < 0) @@ -561,7 +559,7 @@ DWORD /* lData2 */) connection->m_hConv = 0; connection->m_topicName = topic_buf; DDECurrentlyConnecting = connection; - return (DDERETURN)TRUE; + return (DDERETURN)(DWORD)TRUE; } } else return (DDERETURN)0; @@ -574,7 +572,7 @@ DWORD /* lData2 */) { DDECurrentlyConnecting->m_hConv = (WXHCONV) hConv; DDECurrentlyConnecting = NULL; - return (DDERETURN)TRUE; + return (DDERETURN)(DWORD)TRUE; } else return 0; break; @@ -586,7 +584,7 @@ DWORD /* lData2 */) if (connection && connection->OnDisconnect()) { DDEDeleteConnection(hConv); // Delete mapping: hConv => connection - return (DDERETURN)TRUE; + return (DDERETURN)(DWORD)TRUE; } else return (DDERETURN)0; break; @@ -601,7 +599,7 @@ DWORD /* lData2 */) DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0); DdeFreeDataHandle(hData); if (connection->OnExecute(connection->m_topicName, connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt)) - return (DDERETURN)DDE_FACK; + return (DDERETURN)(DWORD)DDE_FACK; else return (DDERETURN)DDE_FNOTPROCESSED; } else return (DDERETURN)DDE_FNOTPROCESSED; @@ -644,7 +642,7 @@ DWORD /* lData2 */) DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0); DdeFreeDataHandle(hData); connection->OnPoke(connection->m_topicName, wxString(item_name), connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt); - return (DDERETURN)DDE_FACK; + return (DDERETURN)(DWORD)DDE_FACK; } else return (DDERETURN)DDE_FNOTPROCESSED; break; } @@ -659,7 +657,7 @@ DWORD /* lData2 */) DdeQueryString(DDEIdInst, hsz2, (LPTSTR)item_name, WXSIZEOF(item_name), CP_WINANSI); - return (DDERETURN)connection->OnStartAdvise(connection->m_topicName, wxString(item_name)); + return (DDERETURN)(DWORD)connection->OnStartAdvise(connection->m_topicName, wxString(item_name)); } else return (DDERETURN)0; break; } @@ -673,7 +671,7 @@ DWORD /* lData2 */) wxChar item_name[200]; DdeQueryString(DDEIdInst, hsz2, (LPTSTR)item_name, WXSIZEOF(item_name), CP_WINANSI); - return (DDERETURN)connection->OnStopAdvise(connection->m_topicName, wxString(item_name)); + return (DDERETURN)(DWORD)connection->OnStopAdvise(connection->m_topicName, wxString(item_name)); } else return (DDERETURN)0; break; } @@ -706,7 +704,7 @@ DWORD /* lData2 */) DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0); DdeFreeDataHandle(hData); if (connection->OnAdvise(connection->m_topicName, wxString(item_name), connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt)) - return (DDERETURN)DDE_FACK; + return (DDERETURN)(DWORD)DDE_FACK; else return (DDERETURN)DDE_FNOTPROCESSED; } else return (DDERETURN)DDE_FNOTPROCESSED; @@ -742,64 +740,64 @@ void DDEPrintError(void) switch (DdeGetLastError(DDEIdInst)) { case DMLERR_ADVACKTIMEOUT: - err = _T("A request for a synchronous advise transaction has timed out."); + err = wxT("A request for a synchronous advise transaction has timed out."); break; case DMLERR_BUSY: - err = _T("The response to the transaction caused the DDE_FBUSY bit to be set."); + err = wxT("The response to the transaction caused the DDE_FBUSY bit to be set."); break; case DMLERR_DATAACKTIMEOUT: - err = _T("A request for a synchronous data transaction has timed out."); + err = wxT("A request for a synchronous data transaction has timed out."); break; case DMLERR_DLL_NOT_INITIALIZED: - err = _T("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 = wxT("A DDEML function was called without first calling the DdeInitialize function,\n\ror an invalid instance identifier\n\rwas passed to a DDEML function."); break; case DMLERR_DLL_USAGE: - err = _T("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 = wxT("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."); break; case DMLERR_EXECACKTIMEOUT: - err = _T("A request for a synchronous execute transaction has timed out."); + err = wxT("A request for a synchronous execute transaction has timed out."); break; case DMLERR_INVALIDPARAMETER: - err = _T("A parameter failed to be validated by the DDEML."); + err = wxT("A parameter failed to be validated by the DDEML."); break; case DMLERR_LOW_MEMORY: - err = _T("A DDEML application has created a prolonged race condition."); + err = wxT("A DDEML application has created a prolonged race condition."); break; case DMLERR_MEMORY_ERROR: - err = _T("A memory allocation failed."); + err = wxT("A memory allocation failed."); break; case DMLERR_NO_CONV_ESTABLISHED: - err = _T("A client's attempt to establish a conversation has failed."); + err = wxT("A client's attempt to establish a conversation has failed."); break; case DMLERR_NOTPROCESSED: - err = _T("A transaction failed."); + err = wxT("A transaction failed."); break; case DMLERR_POKEACKTIMEOUT: - err = _T("A request for a synchronous poke transaction has timed out."); + err = wxT("A request for a synchronous poke transaction has timed out."); break; case DMLERR_POSTMSG_FAILED: - err = _T("An internal call to the PostMessage function has failed. "); + err = wxT("An internal call to the PostMessage function has failed. "); break; case DMLERR_REENTRANCY: - err = _T("Reentrancy problem."); + err = wxT("Reentrancy problem."); break; case DMLERR_SERVER_DIED: - err = _T("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 = wxT("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."); break; case DMLERR_SYS_ERROR: - err = _T("An internal error has occurred in the DDEML."); + err = wxT("An internal error has occurred in the DDEML."); break; case DMLERR_UNADVACKTIMEOUT: - err = _T("A request to end an advise transaction has timed out."); + err = wxT("A request to end an advise transaction has timed out."); break; case DMLERR_UNFOUND_QUEUE_ID: - err = _T("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 = wxT("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."); break; default: - err = _T("Unrecognised error type."); + err = wxT("Unrecognised error type."); break; } - MessageBox((HWND) NULL, (LPCTSTR)err, _T("DDE Error"), MB_OK | MB_ICONINFORMATION); + MessageBox((HWND) NULL, (LPCTSTR)err, wxT("DDE Error"), MB_OK | MB_ICONINFORMATION); } #endif