1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: DDE classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "dde.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
38 #include "wx/module.h"
41 #include "wx/hashmap.h"
43 #include "wx/msw/private.h"
48 // ----------------------------------------------------------------------------
49 // macros and constants
50 // ----------------------------------------------------------------------------
55 #define _EXPORT _export
59 #define DDE_CP CP_WINUNICODE
61 #define DDE_CP CP_WINANSI
64 #define GetHConv() ((HCONV)m_hConv)
66 // default timeout for DDE operations (5sec)
67 #define DDE_TIMEOUT 5000
69 // ----------------------------------------------------------------------------
71 // ----------------------------------------------------------------------------
73 static wxDDEConnection
*DDEFindConnection(HCONV hConv
);
74 static void DDEDeleteConnection(HCONV hConv
);
75 static wxDDEServer
*DDEFindServer(const wxString
& s
);
77 extern "C" HDDEDATA EXPENTRY _EXPORT
_DDECallback(WORD wType
,
86 // Add topic name to atom table before using in conversations
87 static HSZ
DDEAddAtom(const wxString
& string
);
88 static HSZ
DDEGetAtom(const wxString
& string
);
91 static HSZ
DDEAtomFromString(const wxString
& s
);
92 static wxString
DDEStringFromAtom(HSZ hsz
);
93 static void DDEFreeString(HSZ hsz
);
96 static wxString
DDEGetErrorMsg(UINT error
);
97 static void DDELogError(const wxString
& s
, UINT error
= DMLERR_NO_ERROR
);
99 // ----------------------------------------------------------------------------
101 // ----------------------------------------------------------------------------
103 WX_DECLARE_STRING_HASH_MAP( HSZ
, wxAtomMap
);
105 static DWORD DDEIdInst
= 0L;
106 static wxDDEConnection
*DDECurrentlyConnecting
= NULL
;
107 static wxAtomMap wxAtomTable
;
109 #include "wx/listimpl.cpp"
111 WX_DEFINE_LIST(wxDDEClientList
);
112 WX_DEFINE_LIST(wxDDEServerList
);
113 WX_DEFINE_LIST(wxDDEConnectionList
);
115 static wxDDEClientList wxDDEClientObjects
;
116 static wxDDEServerList wxDDEServerObjects
;
118 static bool DDEInitialized
= false;
120 // ----------------------------------------------------------------------------
122 // ----------------------------------------------------------------------------
124 // A module to allow DDE cleanup without calling these functions
125 // from app.cpp or from the user's application.
127 class wxDDEModule
: public wxModule
131 bool OnInit() { return true; }
132 void OnExit() { wxDDECleanUp(); }
135 DECLARE_DYNAMIC_CLASS(wxDDEModule
)
138 // ----------------------------------------------------------------------------
140 // ----------------------------------------------------------------------------
142 IMPLEMENT_DYNAMIC_CLASS(wxDDEServer
, wxServerBase
)
143 IMPLEMENT_DYNAMIC_CLASS(wxDDEClient
, wxClientBase
)
144 IMPLEMENT_CLASS(wxDDEConnection
, wxConnectionBase
)
145 IMPLEMENT_DYNAMIC_CLASS(wxDDEModule
, wxModule
)
147 // ============================================================================
149 // ============================================================================
151 // ----------------------------------------------------------------------------
152 // initialization and cleanup
153 // ----------------------------------------------------------------------------
155 extern void wxDDEInitialize()
157 if ( !DDEInitialized
)
159 // Should insert filter flags
160 PFNCALLBACK callback
= (PFNCALLBACK
)
161 MakeProcInstance((FARPROC
)_DDECallback
, wxGetInstance());
162 UINT rc
= DdeInitialize(&DDEIdInst
, callback
, APPCLASS_STANDARD
, 0L);
163 if ( rc
!= DMLERR_NO_ERROR
)
165 DDELogError(_T("Failed to initialize DDE"), rc
);
169 DDEInitialized
= true;
176 // deleting them later won't work as DDE won't be initialized any more
177 wxASSERT_MSG( wxDDEServerObjects
.empty() &&
178 wxDDEClientObjects
.empty(),
179 _T("all DDE objects should be deleted by now") );
183 if ( DDEIdInst
!= 0 )
185 DdeUninitialize(DDEIdInst
);
190 // ----------------------------------------------------------------------------
191 // functions working with the global connection list(s)
192 // ----------------------------------------------------------------------------
194 // Global find connection
195 static wxDDEConnection
*DDEFindConnection(HCONV hConv
)
197 wxDDEServerList::compatibility_iterator serverNode
= wxDDEServerObjects
.GetFirst();
198 wxDDEConnection
*found
= NULL
;
199 while (serverNode
&& !found
)
201 wxDDEServer
*object
= serverNode
->GetData();
202 found
= object
->FindConnection((WXHCONV
) hConv
);
203 serverNode
= serverNode
->GetNext();
211 wxDDEClientList::compatibility_iterator clientNode
= wxDDEClientObjects
.GetFirst();
212 while (clientNode
&& !found
)
214 wxDDEClient
*object
= clientNode
->GetData();
215 found
= object
->FindConnection((WXHCONV
) hConv
);
216 clientNode
= clientNode
->GetNext();
221 // Global delete connection
222 static void DDEDeleteConnection(HCONV hConv
)
224 wxDDEServerList::compatibility_iterator serverNode
= wxDDEServerObjects
.GetFirst();
226 while (serverNode
&& !found
)
228 wxDDEServer
*object
= serverNode
->GetData();
229 found
= object
->DeleteConnection((WXHCONV
) hConv
);
230 serverNode
= serverNode
->GetNext();
237 wxDDEClientList::compatibility_iterator clientNode
= wxDDEClientObjects
.GetFirst();
238 while (clientNode
&& !found
)
240 wxDDEClient
*object
= clientNode
->GetData();
241 found
= object
->DeleteConnection((WXHCONV
) hConv
);
242 clientNode
= clientNode
->GetNext();
246 // Find a server from a service name
247 static wxDDEServer
*DDEFindServer(const wxString
& s
)
249 wxDDEServerList::compatibility_iterator node
= wxDDEServerObjects
.GetFirst();
250 wxDDEServer
*found
= NULL
;
251 while (node
&& !found
)
253 wxDDEServer
*object
= node
->GetData();
255 if (object
->GetServiceName() == s
)
261 node
= node
->GetNext();
268 // ----------------------------------------------------------------------------
270 // ----------------------------------------------------------------------------
272 wxDDEServer::wxDDEServer()
276 wxDDEServerObjects
.Append(this);
279 bool wxDDEServer::Create(const wxString
& server
)
281 m_serviceName
= server
;
283 HSZ hsz
= DDEAtomFromString(server
);
291 bool success
= (DdeNameService(DDEIdInst
, hsz
, (HSZ
) NULL
, DNS_REGISTER
)
296 DDELogError(wxString::Format(_("Failed to register DDE server '%s'"),
305 wxDDEServer::~wxDDEServer()
307 if ( !m_serviceName
.IsEmpty() )
309 HSZ hsz
= DDEAtomFromString(m_serviceName
);
313 if ( !DdeNameService(DDEIdInst
, hsz
,
314 (HSZ
) NULL
, DNS_UNREGISTER
) )
316 DDELogError(wxString::Format(
317 _("Failed to unregister DDE server '%s'"),
318 m_serviceName
.c_str()));
325 wxDDEServerObjects
.DeleteObject(this);
327 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
330 wxDDEConnection
*connection
= node
->GetData();
331 wxDDEConnectionList::compatibility_iterator next
= node
->GetNext();
332 connection
->SetConnected(false);
333 connection
->OnDisconnect(); // May delete the node implicitly
337 // If any left after this, delete them
338 node
= m_connections
.GetFirst();
341 wxDDEConnection
*connection
= node
->GetData();
342 wxDDEConnectionList::compatibility_iterator next
= node
->GetNext();
348 wxConnectionBase
*wxDDEServer::OnAcceptConnection(const wxString
& /* topic */)
350 return new wxDDEConnection
;
353 wxDDEConnection
*wxDDEServer::FindConnection(WXHCONV conv
)
355 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
356 wxDDEConnection
*found
= NULL
;
357 while (node
&& !found
)
359 wxDDEConnection
*connection
= node
->GetData();
360 if (connection
->m_hConv
== conv
)
362 else node
= node
->GetNext();
367 // Only delete the entry in the map, not the actual connection
368 bool wxDDEServer::DeleteConnection(WXHCONV conv
)
370 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
373 wxDDEConnection
*connection
= node
->GetData();
374 if (connection
->m_hConv
== conv
)
376 m_connections
.Erase(node
);
381 node
= node
->GetNext();
387 // ----------------------------------------------------------------------------
389 // ----------------------------------------------------------------------------
391 wxDDEClient::wxDDEClient()
395 wxDDEClientObjects
.Append(this);
398 wxDDEClient::~wxDDEClient()
400 wxDDEClientObjects
.DeleteObject(this);
401 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
404 wxDDEConnection
*connection
= node
->GetData();
405 delete connection
; // Deletes the node implicitly (see ~wxDDEConnection)
406 node
= m_connections
.GetFirst();
410 bool wxDDEClient::ValidHost(const wxString
& /* host */)
415 wxConnectionBase
*wxDDEClient::MakeConnection(const wxString
& WXUNUSED(host
),
416 const wxString
& server
,
417 const wxString
& topic
)
419 HSZ hszServer
= DDEAtomFromString(server
);
423 return (wxConnectionBase
*) NULL
;
427 HSZ hszTopic
= DDEAtomFromString(topic
);
431 DDEFreeString(hszServer
);
432 return (wxConnectionBase
*) NULL
;
436 HCONV hConv
= ::DdeConnect(DDEIdInst
, hszServer
, hszTopic
,
437 (PCONVCONTEXT
) NULL
);
439 DDEFreeString(hszServer
);
440 DDEFreeString(hszTopic
);
445 DDELogError( wxString::Format(
446 _("Failed to create connection to server '%s' on topic '%s'"),
447 server
.c_str(), topic
.c_str()) );
451 wxDDEConnection
*connection
= (wxDDEConnection
*) OnMakeConnection();
454 connection
->m_hConv
= (WXHCONV
) hConv
;
455 connection
->m_topicName
= topic
;
456 connection
->m_client
= this;
457 m_connections
.Append(connection
);
462 return (wxConnectionBase
*) NULL
;
465 wxConnectionBase
*wxDDEClient::OnMakeConnection()
467 return new wxDDEConnection
;
470 wxDDEConnection
*wxDDEClient::FindConnection(WXHCONV conv
)
472 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
473 wxDDEConnection
*found
= NULL
;
474 while (node
&& !found
)
476 wxDDEConnection
*connection
= node
->GetData();
477 if (connection
->m_hConv
== conv
)
479 else node
= node
->GetNext();
484 // Only delete the entry in the map, not the actual connection
485 bool wxDDEClient::DeleteConnection(WXHCONV conv
)
487 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
490 wxDDEConnection
*connection
= node
->GetData();
491 if (connection
->m_hConv
== conv
)
493 m_connections
.Erase(node
);
496 else node
= node
->GetNext();
501 // ----------------------------------------------------------------------------
503 // ----------------------------------------------------------------------------
505 wxDDEConnection::wxDDEConnection(wxChar
*buffer
, int size
)
506 : wxConnectionBase(buffer
, size
)
512 m_sendingData
= NULL
;
515 wxDDEConnection::wxDDEConnection()
519 m_sendingData
= NULL
;
524 wxDDEConnection::~wxDDEConnection()
528 m_server
->GetConnections().DeleteObject(this);
530 m_client
->GetConnections().DeleteObject(this);
533 // Calls that CLIENT can make
534 bool wxDDEConnection::Disconnect()
536 if ( !GetConnected() )
539 DDEDeleteConnection(GetHConv());
541 bool ok
= DdeDisconnect(GetHConv()) != 0;
544 DDELogError(_T("Failed to disconnect from DDE server gracefully"));
547 SetConnected( false ); // so we don't try and disconnect again
552 bool wxDDEConnection::Execute(const wxChar
*data
, int size
, wxIPCFormat
WXUNUSED(format
))
557 size
= (wxStrlen(data
) + 1) * sizeof(wxChar
); // includes final NUL
560 bool ok
= DdeClientTransaction((LPBYTE
)data
,
564 // If the transaction specified by the wType parameter does not pass data or is XTYP_EXECUTE,
565 // wFmt should be zero.
573 DDELogError(_T("DDE execute request failed"));
579 wxChar
*wxDDEConnection::Request(const wxString
& item
, int *size
, wxIPCFormat format
)
583 HSZ atom
= DDEGetAtom(item
);
585 HDDEDATA returned_data
= DdeClientTransaction(NULL
, 0,
591 if ( !returned_data
)
593 DDELogError(_T("DDE data request failed"));
598 DWORD len
= DdeGetData(returned_data
, NULL
, 0, 0);
600 wxChar
*data
= GetBufferAtLeast( len
);
601 wxASSERT_MSG(data
!= NULL
,
602 _T("Buffer too small in wxDDEConnection::Request") );
603 (void) DdeGetData(returned_data
, (LPBYTE
)data
, len
, 0);
605 (void) DdeFreeDataHandle(returned_data
);
613 bool wxDDEConnection::Poke(const wxString
& item
, wxChar
*data
, int size
, wxIPCFormat format
)
618 size
= (wxStrlen(data
) + 1) * sizeof(wxChar
); // includes final NUL
621 HSZ item_atom
= DDEGetAtom(item
);
622 bool ok
= DdeClientTransaction((LPBYTE
)data
,
631 DDELogError(_("DDE poke request failed"));
637 bool wxDDEConnection::StartAdvise(const wxString
& item
)
640 HSZ atom
= DDEGetAtom(item
);
642 bool ok
= DdeClientTransaction(NULL
, 0,
650 DDELogError(_("Failed to establish an advise loop with DDE server"));
656 bool wxDDEConnection::StopAdvise(const wxString
& item
)
659 HSZ atom
= DDEGetAtom(item
);
661 bool ok
= DdeClientTransaction(NULL
, 0,
669 DDELogError(_("Failed to terminate the advise loop with DDE server"));
675 // Calls that SERVER can make
676 bool wxDDEConnection::Advise(const wxString
& item
,
683 size
= (wxStrlen(data
) + 1) * sizeof(wxChar
); // includes final NUL
686 HSZ item_atom
= DDEGetAtom(item
);
687 HSZ topic_atom
= DDEGetAtom(m_topicName
);
688 m_sendingData
= data
; // mrf: potential for scope problems here?
690 // wxIPC_PRIVATE does not succeed, so use text instead
691 m_dataType
= format
== wxIPC_PRIVATE
? wxIPC_TEXT
: format
;
693 bool ok
= DdePostAdvise(DDEIdInst
, topic_atom
, item_atom
) != 0;
696 DDELogError(_("Failed to send DDE advise notification"));
702 bool wxDDEConnection::OnDisconnect()
708 // ----------------------------------------------------------------------------
710 // ----------------------------------------------------------------------------
712 #define DDERETURN HDDEDATA
714 HDDEDATA EXPENTRY _EXPORT
715 _DDECallback(WORD wType
,
721 DWORD
WXUNUSED(lData1
),
722 DWORD
WXUNUSED(lData2
))
728 wxString topic
= DDEStringFromAtom(hsz1
),
729 srv
= DDEStringFromAtom(hsz2
);
730 wxDDEServer
*server
= DDEFindServer(srv
);
733 wxDDEConnection
*connection
=
734 (wxDDEConnection
*) server
->OnAcceptConnection(topic
);
737 connection
->m_server
= server
;
738 server
->GetConnections().Append(connection
);
739 connection
->m_hConv
= 0;
740 connection
->m_topicName
= topic
;
741 DDECurrentlyConnecting
= connection
;
742 return (DDERETURN
)(DWORD
)true;
748 case XTYP_CONNECT_CONFIRM
:
750 if (DDECurrentlyConnecting
)
752 DDECurrentlyConnecting
->m_hConv
= (WXHCONV
) hConv
;
753 DDECurrentlyConnecting
= NULL
;
754 return (DDERETURN
)(DWORD
)true;
759 case XTYP_DISCONNECT
:
761 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
764 connection
->SetConnected( false );
765 if (connection
->OnDisconnect())
767 DDEDeleteConnection(hConv
); // Delete mapping: hConv => connection
768 return (DDERETURN
)(DWORD
)true;
776 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
780 DWORD len
= DdeGetData(hData
, NULL
, 0, 0);
782 wxChar
*data
= connection
->GetBufferAtLeast( len
);
783 wxASSERT_MSG(data
!= NULL
,
784 _T("Buffer too small in _DDECallback (XTYP_EXECUTE)") );
786 DdeGetData(hData
, (LPBYTE
)data
, len
, 0);
788 DdeFreeDataHandle(hData
);
790 // XTYP_EXECUTE cannot be used for arbitrary data, but only for text
791 if ( connection
->OnExecute(connection
->m_topicName
,
796 return (DDERETURN
)(DWORD
)DDE_FACK
;
800 return (DDERETURN
)DDE_FNOTPROCESSED
;
805 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
809 wxString item_name
= DDEStringFromAtom(hsz2
);
812 wxChar
*data
= connection
->OnRequest(connection
->m_topicName
,
819 user_size
= (wxStrlen((wxChar
*)data
) + 1) * sizeof(wxChar
); // includes final NUL
821 HDDEDATA handle
= DdeCreateDataHandle(DDEIdInst
,
828 return (DDERETURN
)handle
;
836 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
840 wxString item_name
= DDEStringFromAtom(hsz2
);
842 DWORD len
= DdeGetData(hData
, NULL
, 0, 0);
844 wxChar
*data
= connection
->GetBufferAtLeast( len
);
845 wxASSERT_MSG(data
!= NULL
,
846 _T("Buffer too small in _DDECallback (XTYP_POKE)") );
848 DdeGetData(hData
, (LPBYTE
)data
, len
, 0);
850 DdeFreeDataHandle(hData
);
852 connection
->OnPoke(connection
->m_topicName
,
858 return (DDERETURN
)DDE_FACK
;
862 return (DDERETURN
)DDE_FNOTPROCESSED
;
868 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
872 wxString item_name
= DDEStringFromAtom(hsz2
);
874 return (DDERETURN
)connection
->
875 OnStartAdvise(connection
->m_topicName
, item_name
);
883 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
887 wxString item_name
= DDEStringFromAtom(hsz2
);
889 return (DDERETURN
)connection
->
890 OnStopAdvise(connection
->m_topicName
, item_name
);
898 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
900 if (connection
&& connection
->m_sendingData
)
902 HDDEDATA data
= DdeCreateDataHandle
905 (LPBYTE
)connection
->m_sendingData
,
906 connection
->m_dataSize
,
909 connection
->m_dataType
,
913 connection
->m_sendingData
= NULL
;
915 return (DDERETURN
)data
;
923 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
927 wxString item_name
= DDEStringFromAtom(hsz2
);
929 DWORD len
= DdeGetData(hData
, NULL
, 0, 0);
931 wxChar
*data
= connection
->GetBufferAtLeast( len
);
932 wxASSERT_MSG(data
!= NULL
,
933 _T("Buffer too small in _DDECallback (XTYP_ADVDATA)") );
935 DdeGetData(hData
, (LPBYTE
)data
, len
, 0);
937 DdeFreeDataHandle(hData
);
938 if ( connection
->OnAdvise(connection
->m_topicName
,
942 (wxIPCFormat
) wFmt
) )
944 return (DDERETURN
)(DWORD
)DDE_FACK
;
948 return (DDERETURN
)DDE_FNOTPROCESSED
;
955 // ----------------------------------------------------------------------------
956 // DDE strings and atoms
957 // ----------------------------------------------------------------------------
960 static HSZ
DDEAddAtom(const wxString
& str
)
962 HSZ atom
= DDEAtomFromString(str
);
963 wxAtomTable
[str
] = atom
;
967 static HSZ
DDEGetAtom(const wxString
& str
)
969 wxAtomMap::iterator it
= wxAtomTable
.find(str
);
971 if (it
!= wxAtomTable
.end())
974 return DDEAddAtom(str
);
978 The returned handle has to be freed by the caller (using
979 (static) DDEFreeString).
981 static HSZ
DDEAtomFromString(const wxString
& s
)
983 wxASSERT_MSG( DDEIdInst
, _T("DDE not initialized") );
985 HSZ hsz
= DdeCreateStringHandle(DDEIdInst
, (wxChar
*) s
.c_str(), DDE_CP
);
988 DDELogError(_("Failed to create DDE string"));
994 static wxString
DDEStringFromAtom(HSZ hsz
)
996 // all DDE strings are normally limited to 255 bytes
997 static const size_t len
= 256;
1000 (void)DdeQueryString(DDEIdInst
, hsz
, wxStringBuffer(s
, len
), len
, DDE_CP
);
1005 static void DDEFreeString(HSZ hsz
)
1007 // DS: Failure to free a string handle might indicate there's
1008 // some other severe error.
1009 bool ok
= (::DdeFreeStringHandle(DDEIdInst
, hsz
) != 0);
1010 wxASSERT_MSG( ok
, wxT("Failed to free DDE string handle") );
1014 // ----------------------------------------------------------------------------
1016 // ----------------------------------------------------------------------------
1018 static void DDELogError(const wxString
& s
, UINT error
)
1022 error
= DdeGetLastError(DDEIdInst
);
1025 wxLogError(s
+ _T(": ") + DDEGetErrorMsg(error
));
1028 static wxString
DDEGetErrorMsg(UINT error
)
1033 case DMLERR_NO_ERROR
:
1034 err
= _("no DDE error.");
1037 case DMLERR_ADVACKTIMEOUT
:
1038 err
= _("a request for a synchronous advise transaction has timed out.");
1041 err
= _("the response to the transaction caused the DDE_FBUSY bit to be set.");
1043 case DMLERR_DATAACKTIMEOUT
:
1044 err
= _("a request for a synchronous data transaction has timed out.");
1046 case DMLERR_DLL_NOT_INITIALIZED
:
1047 err
= _("a DDEML function was called without first calling the DdeInitialize function,\nor an invalid instance identifier\nwas passed to a DDEML function.");
1049 case DMLERR_DLL_USAGE
:
1050 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.");
1052 case DMLERR_EXECACKTIMEOUT
:
1053 err
= _("a request for a synchronous execute transaction has timed out.");
1055 case DMLERR_INVALIDPARAMETER
:
1056 err
= _("a parameter failed to be validated by the DDEML.");
1058 case DMLERR_LOW_MEMORY
:
1059 err
= _("a DDEML application has created a prolonged race condition.");
1061 case DMLERR_MEMORY_ERROR
:
1062 err
= _("a memory allocation failed.");
1064 case DMLERR_NO_CONV_ESTABLISHED
:
1065 err
= _("a client's attempt to establish a conversation has failed.");
1067 case DMLERR_NOTPROCESSED
:
1068 err
= _("a transaction failed.");
1070 case DMLERR_POKEACKTIMEOUT
:
1071 err
= _("a request for a synchronous poke transaction has timed out.");
1073 case DMLERR_POSTMSG_FAILED
:
1074 err
= _("an internal call to the PostMessage function has failed. ");
1076 case DMLERR_REENTRANCY
:
1077 err
= _("reentrancy problem.");
1079 case DMLERR_SERVER_DIED
:
1080 err
= _("a server-side transaction was attempted on a conversation\nthat was terminated by the client, or the server\nterminated before completing a transaction.");
1082 case DMLERR_SYS_ERROR
:
1083 err
= _("an internal error has occurred in the DDEML.");
1085 case DMLERR_UNADVACKTIMEOUT
:
1086 err
= _("a request to end an advise transaction has timed out.");
1088 case DMLERR_UNFOUND_QUEUE_ID
:
1089 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.");
1092 err
.Printf(_("Unknown DDE error %08x"), error
);