1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/dde.cpp
3 // Purpose: DDE classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
32 #include "wx/hashmap.h"
33 #include "wx/module.h"
39 #include "wx/msw/private.h"
44 // ----------------------------------------------------------------------------
45 // macros and constants
46 // ----------------------------------------------------------------------------
51 #define _EXPORT _export
55 #define DDE_CP CP_WINUNICODE
57 #define DDE_CP CP_WINANSI
60 #define GetHConv() ((HCONV)m_hConv)
62 // default timeout for DDE operations (5sec)
63 #define DDE_TIMEOUT 5000
65 // ----------------------------------------------------------------------------
67 // ----------------------------------------------------------------------------
69 static wxDDEConnection
*DDEFindConnection(HCONV hConv
);
70 static void DDEDeleteConnection(HCONV hConv
);
71 static wxDDEServer
*DDEFindServer(const wxString
& s
);
73 extern "C" HDDEDATA EXPENTRY _EXPORT
_DDECallback(WORD wType
,
82 // Add topic name to atom table before using in conversations
83 static HSZ
DDEAddAtom(const wxString
& string
);
84 static HSZ
DDEGetAtom(const wxString
& string
);
87 static HSZ
DDEAtomFromString(const wxString
& s
);
88 static wxString
DDEStringFromAtom(HSZ hsz
);
89 static void DDEFreeString(HSZ hsz
);
92 static wxString
DDEGetErrorMsg(UINT error
);
93 static void DDELogError(const wxString
& s
, UINT error
= DMLERR_NO_ERROR
);
95 // ----------------------------------------------------------------------------
97 // ----------------------------------------------------------------------------
99 WX_DECLARE_STRING_HASH_MAP( HSZ
, wxAtomMap
);
101 static DWORD DDEIdInst
= 0L;
102 static wxDDEConnection
*DDECurrentlyConnecting
= NULL
;
103 static wxAtomMap wxAtomTable
;
105 #include "wx/listimpl.cpp"
107 WX_DEFINE_LIST(wxDDEClientList
)
108 WX_DEFINE_LIST(wxDDEServerList
)
109 WX_DEFINE_LIST(wxDDEConnectionList
)
111 static wxDDEClientList wxDDEClientObjects
;
112 static wxDDEServerList wxDDEServerObjects
;
114 static bool DDEInitialized
= false;
116 // ----------------------------------------------------------------------------
118 // ----------------------------------------------------------------------------
120 // A module to allow DDE cleanup without calling these functions
121 // from app.cpp or from the user's application.
123 class wxDDEModule
: public wxModule
127 bool OnInit() { return true; }
128 void OnExit() { wxDDECleanUp(); }
131 DECLARE_DYNAMIC_CLASS(wxDDEModule
)
134 // ----------------------------------------------------------------------------
136 // ----------------------------------------------------------------------------
138 IMPLEMENT_DYNAMIC_CLASS(wxDDEServer
, wxServerBase
)
139 IMPLEMENT_DYNAMIC_CLASS(wxDDEClient
, wxClientBase
)
140 IMPLEMENT_CLASS(wxDDEConnection
, wxConnectionBase
)
141 IMPLEMENT_DYNAMIC_CLASS(wxDDEModule
, wxModule
)
143 // ============================================================================
145 // ============================================================================
147 // ----------------------------------------------------------------------------
148 // initialization and cleanup
149 // ----------------------------------------------------------------------------
151 extern void wxDDEInitialize()
153 if ( !DDEInitialized
)
155 // Should insert filter flags
156 PFNCALLBACK callback
= (PFNCALLBACK
)
157 MakeProcInstance((FARPROC
)_DDECallback
, wxGetInstance());
158 UINT rc
= DdeInitialize(&DDEIdInst
, callback
, APPCLASS_STANDARD
, 0L);
159 if ( rc
!= DMLERR_NO_ERROR
)
161 DDELogError(_T("Failed to initialize DDE"), rc
);
165 DDEInitialized
= true;
172 // deleting them later won't work as DDE won't be initialized any more
173 wxASSERT_MSG( wxDDEServerObjects
.empty() &&
174 wxDDEClientObjects
.empty(),
175 _T("all DDE objects should be deleted by now") );
179 if ( DDEIdInst
!= 0 )
181 DdeUninitialize(DDEIdInst
);
186 // ----------------------------------------------------------------------------
187 // functions working with the global connection list(s)
188 // ----------------------------------------------------------------------------
190 // Global find connection
191 static wxDDEConnection
*DDEFindConnection(HCONV hConv
)
193 wxDDEServerList::compatibility_iterator serverNode
= wxDDEServerObjects
.GetFirst();
194 wxDDEConnection
*found
= NULL
;
195 while (serverNode
&& !found
)
197 wxDDEServer
*object
= serverNode
->GetData();
198 found
= object
->FindConnection((WXHCONV
) hConv
);
199 serverNode
= serverNode
->GetNext();
207 wxDDEClientList::compatibility_iterator clientNode
= wxDDEClientObjects
.GetFirst();
208 while (clientNode
&& !found
)
210 wxDDEClient
*object
= clientNode
->GetData();
211 found
= object
->FindConnection((WXHCONV
) hConv
);
212 clientNode
= clientNode
->GetNext();
217 // Global delete connection
218 static void DDEDeleteConnection(HCONV hConv
)
220 wxDDEServerList::compatibility_iterator serverNode
= wxDDEServerObjects
.GetFirst();
222 while (serverNode
&& !found
)
224 wxDDEServer
*object
= serverNode
->GetData();
225 found
= object
->DeleteConnection((WXHCONV
) hConv
);
226 serverNode
= serverNode
->GetNext();
233 wxDDEClientList::compatibility_iterator clientNode
= wxDDEClientObjects
.GetFirst();
234 while (clientNode
&& !found
)
236 wxDDEClient
*object
= clientNode
->GetData();
237 found
= object
->DeleteConnection((WXHCONV
) hConv
);
238 clientNode
= clientNode
->GetNext();
242 // Find a server from a service name
243 static wxDDEServer
*DDEFindServer(const wxString
& s
)
245 wxDDEServerList::compatibility_iterator node
= wxDDEServerObjects
.GetFirst();
246 wxDDEServer
*found
= NULL
;
247 while (node
&& !found
)
249 wxDDEServer
*object
= node
->GetData();
251 if (object
->GetServiceName() == s
)
257 node
= node
->GetNext();
264 // ----------------------------------------------------------------------------
266 // ----------------------------------------------------------------------------
268 wxDDEServer::wxDDEServer()
272 wxDDEServerObjects
.Append(this);
275 bool wxDDEServer::Create(const wxString
& server
)
277 m_serviceName
= server
;
279 HSZ hsz
= DDEAtomFromString(server
);
287 bool success
= (DdeNameService(DDEIdInst
, hsz
, (HSZ
) NULL
, DNS_REGISTER
)
292 DDELogError(wxString::Format(_("Failed to register DDE server '%s'"),
301 wxDDEServer::~wxDDEServer()
303 if ( !m_serviceName
.empty() )
305 HSZ hsz
= DDEAtomFromString(m_serviceName
);
309 if ( !DdeNameService(DDEIdInst
, hsz
,
310 (HSZ
) NULL
, DNS_UNREGISTER
) )
312 DDELogError(wxString::Format(
313 _("Failed to unregister DDE server '%s'"),
314 m_serviceName
.c_str()));
321 wxDDEServerObjects
.DeleteObject(this);
323 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
326 wxDDEConnection
*connection
= node
->GetData();
327 wxDDEConnectionList::compatibility_iterator next
= node
->GetNext();
328 connection
->SetConnected(false);
329 connection
->OnDisconnect(); // May delete the node implicitly
333 // If any left after this, delete them
334 node
= m_connections
.GetFirst();
337 wxDDEConnection
*connection
= node
->GetData();
338 wxDDEConnectionList::compatibility_iterator next
= node
->GetNext();
344 wxConnectionBase
*wxDDEServer::OnAcceptConnection(const wxString
& /* topic */)
346 return new wxDDEConnection
;
349 wxDDEConnection
*wxDDEServer::FindConnection(WXHCONV conv
)
351 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
352 wxDDEConnection
*found
= NULL
;
353 while (node
&& !found
)
355 wxDDEConnection
*connection
= node
->GetData();
356 if (connection
->m_hConv
== conv
)
358 else node
= node
->GetNext();
363 // Only delete the entry in the map, not the actual connection
364 bool wxDDEServer::DeleteConnection(WXHCONV conv
)
366 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
369 wxDDEConnection
*connection
= node
->GetData();
370 if (connection
->m_hConv
== conv
)
372 m_connections
.Erase(node
);
377 node
= node
->GetNext();
383 // ----------------------------------------------------------------------------
385 // ----------------------------------------------------------------------------
387 wxDDEClient::wxDDEClient()
391 wxDDEClientObjects
.Append(this);
394 wxDDEClient::~wxDDEClient()
396 wxDDEClientObjects
.DeleteObject(this);
397 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
400 wxDDEConnection
*connection
= node
->GetData();
401 delete connection
; // Deletes the node implicitly (see ~wxDDEConnection)
402 node
= m_connections
.GetFirst();
406 bool wxDDEClient::ValidHost(const wxString
& /* host */)
411 wxConnectionBase
*wxDDEClient::MakeConnection(const wxString
& WXUNUSED(host
),
412 const wxString
& server
,
413 const wxString
& topic
)
415 HSZ hszServer
= DDEAtomFromString(server
);
419 return (wxConnectionBase
*) NULL
;
423 HSZ hszTopic
= DDEAtomFromString(topic
);
427 DDEFreeString(hszServer
);
428 return (wxConnectionBase
*) NULL
;
432 HCONV hConv
= ::DdeConnect(DDEIdInst
, hszServer
, hszTopic
,
433 (PCONVCONTEXT
) NULL
);
435 DDEFreeString(hszServer
);
436 DDEFreeString(hszTopic
);
441 DDELogError( wxString::Format(
442 _("Failed to create connection to server '%s' on topic '%s'"),
443 server
.c_str(), topic
.c_str()) );
447 wxDDEConnection
*connection
= (wxDDEConnection
*) OnMakeConnection();
450 connection
->m_hConv
= (WXHCONV
) hConv
;
451 connection
->m_topicName
= topic
;
452 connection
->m_client
= this;
453 m_connections
.Append(connection
);
458 return (wxConnectionBase
*) NULL
;
461 wxConnectionBase
*wxDDEClient::OnMakeConnection()
463 return new wxDDEConnection
;
466 wxDDEConnection
*wxDDEClient::FindConnection(WXHCONV conv
)
468 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
469 wxDDEConnection
*found
= NULL
;
470 while (node
&& !found
)
472 wxDDEConnection
*connection
= node
->GetData();
473 if (connection
->m_hConv
== conv
)
475 else node
= node
->GetNext();
480 // Only delete the entry in the map, not the actual connection
481 bool wxDDEClient::DeleteConnection(WXHCONV conv
)
483 wxDDEConnectionList::compatibility_iterator node
= m_connections
.GetFirst();
486 wxDDEConnection
*connection
= node
->GetData();
487 if (connection
->m_hConv
== conv
)
489 m_connections
.Erase(node
);
492 else node
= node
->GetNext();
497 // ----------------------------------------------------------------------------
499 // ----------------------------------------------------------------------------
501 wxDDEConnection::wxDDEConnection(wxChar
*buffer
, int size
)
502 : wxConnectionBase(buffer
, size
)
508 m_sendingData
= NULL
;
511 wxDDEConnection::wxDDEConnection()
515 m_sendingData
= NULL
;
520 wxDDEConnection::~wxDDEConnection()
524 m_server
->GetConnections().DeleteObject(this);
526 m_client
->GetConnections().DeleteObject(this);
529 // Calls that CLIENT can make
530 bool wxDDEConnection::Disconnect()
532 if ( !GetConnected() )
535 DDEDeleteConnection(GetHConv());
537 bool ok
= DdeDisconnect(GetHConv()) != 0;
540 DDELogError(_T("Failed to disconnect from DDE server gracefully"));
543 SetConnected( false ); // so we don't try and disconnect again
548 bool wxDDEConnection::Execute(const wxChar
*data
, int size
, wxIPCFormat
WXUNUSED(format
))
553 size
= (wxStrlen(data
) + 1) * sizeof(wxChar
); // includes final NUL
556 bool ok
= DdeClientTransaction((LPBYTE
)data
,
560 // If the transaction specified by the wType parameter does not pass data or is XTYP_EXECUTE,
561 // wFmt should be zero.
569 DDELogError(_T("DDE execute request failed"));
575 wxChar
*wxDDEConnection::Request(const wxString
& item
, int *size
, wxIPCFormat format
)
579 HSZ atom
= DDEGetAtom(item
);
581 HDDEDATA returned_data
= DdeClientTransaction(NULL
, 0,
587 if ( !returned_data
)
589 DDELogError(_T("DDE data request failed"));
594 DWORD len
= DdeGetData(returned_data
, NULL
, 0, 0);
596 wxChar
*data
= GetBufferAtLeast( len
);
597 wxASSERT_MSG(data
!= NULL
,
598 _T("Buffer too small in wxDDEConnection::Request") );
599 (void) DdeGetData(returned_data
, (LPBYTE
)data
, len
, 0);
601 (void) DdeFreeDataHandle(returned_data
);
609 bool wxDDEConnection::Poke(const wxString
& item
, const wxChar
*data
, int size
, wxIPCFormat format
)
614 size
= (wxStrlen(data
) + 1) * sizeof(wxChar
); // includes final NUL
617 HSZ item_atom
= DDEGetAtom(item
);
618 bool ok
= DdeClientTransaction((LPBYTE
)data
,
627 DDELogError(_("DDE poke request failed"));
633 bool wxDDEConnection::StartAdvise(const wxString
& item
)
636 HSZ atom
= DDEGetAtom(item
);
638 bool ok
= DdeClientTransaction(NULL
, 0,
646 DDELogError(_("Failed to establish an advise loop with DDE server"));
652 bool wxDDEConnection::StopAdvise(const wxString
& item
)
655 HSZ atom
= DDEGetAtom(item
);
657 bool ok
= DdeClientTransaction(NULL
, 0,
665 DDELogError(_("Failed to terminate the advise loop with DDE server"));
671 // Calls that SERVER can make
672 bool wxDDEConnection::Advise(const wxString
& item
,
679 size
= (wxStrlen(data
) + 1) * sizeof(wxChar
); // includes final NUL
682 HSZ item_atom
= DDEGetAtom(item
);
683 HSZ topic_atom
= DDEGetAtom(m_topicName
);
684 m_sendingData
= data
; // mrf: potential for scope problems here?
686 // wxIPC_PRIVATE does not succeed, so use text instead
687 m_dataType
= format
== wxIPC_PRIVATE
? wxIPC_TEXT
: format
;
689 bool ok
= DdePostAdvise(DDEIdInst
, topic_atom
, item_atom
) != 0;
692 DDELogError(_("Failed to send DDE advise notification"));
698 bool wxDDEConnection::OnDisconnect()
704 // ----------------------------------------------------------------------------
706 // ----------------------------------------------------------------------------
708 #define DDERETURN HDDEDATA
710 HDDEDATA EXPENTRY _EXPORT
711 _DDECallback(WORD wType
,
717 DWORD
WXUNUSED(lData1
),
718 DWORD
WXUNUSED(lData2
))
724 wxString topic
= DDEStringFromAtom(hsz1
),
725 srv
= DDEStringFromAtom(hsz2
);
726 wxDDEServer
*server
= DDEFindServer(srv
);
729 wxDDEConnection
*connection
=
730 (wxDDEConnection
*) server
->OnAcceptConnection(topic
);
733 connection
->m_server
= server
;
734 server
->GetConnections().Append(connection
);
735 connection
->m_hConv
= 0;
736 connection
->m_topicName
= topic
;
737 DDECurrentlyConnecting
= connection
;
738 return (DDERETURN
)(DWORD
)true;
744 case XTYP_CONNECT_CONFIRM
:
746 if (DDECurrentlyConnecting
)
748 DDECurrentlyConnecting
->m_hConv
= (WXHCONV
) hConv
;
749 DDECurrentlyConnecting
= NULL
;
750 return (DDERETURN
)(DWORD
)true;
755 case XTYP_DISCONNECT
:
757 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
760 connection
->SetConnected( false );
761 if (connection
->OnDisconnect())
763 DDEDeleteConnection(hConv
); // Delete mapping: hConv => connection
764 return (DDERETURN
)(DWORD
)true;
772 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
776 DWORD len
= DdeGetData(hData
, NULL
, 0, 0);
778 wxChar
*data
= connection
->GetBufferAtLeast( len
);
779 wxASSERT_MSG(data
!= NULL
,
780 _T("Buffer too small in _DDECallback (XTYP_EXECUTE)") );
782 DdeGetData(hData
, (LPBYTE
)data
, len
, 0);
784 DdeFreeDataHandle(hData
);
786 // XTYP_EXECUTE cannot be used for arbitrary data, but only for text
787 if ( connection
->OnExecute(connection
->m_topicName
,
792 return (DDERETURN
)(DWORD
)DDE_FACK
;
796 return (DDERETURN
)DDE_FNOTPROCESSED
;
801 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
805 wxString item_name
= DDEStringFromAtom(hsz2
);
808 const wxChar
*data
= connection
->OnRequest(connection
->m_topicName
,
815 user_size
= (wxStrlen((wxChar
*)data
) + 1) * sizeof(wxChar
); // includes final NUL
817 HDDEDATA handle
= DdeCreateDataHandle(DDEIdInst
,
824 return (DDERETURN
)handle
;
832 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
836 wxString item_name
= DDEStringFromAtom(hsz2
);
838 DWORD len
= DdeGetData(hData
, NULL
, 0, 0);
840 wxChar
*data
= connection
->GetBufferAtLeast( len
);
841 wxASSERT_MSG(data
!= NULL
,
842 _T("Buffer too small in _DDECallback (XTYP_POKE)") );
844 DdeGetData(hData
, (LPBYTE
)data
, len
, 0);
846 DdeFreeDataHandle(hData
);
848 connection
->OnPoke(connection
->m_topicName
,
854 return (DDERETURN
)DDE_FACK
;
858 return (DDERETURN
)DDE_FNOTPROCESSED
;
864 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
868 wxString item_name
= DDEStringFromAtom(hsz2
);
870 return (DDERETURN
)connection
->
871 OnStartAdvise(connection
->m_topicName
, item_name
);
879 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
883 wxString item_name
= DDEStringFromAtom(hsz2
);
885 return (DDERETURN
)connection
->
886 OnStopAdvise(connection
->m_topicName
, item_name
);
894 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
896 if (connection
&& connection
->m_sendingData
)
898 HDDEDATA data
= DdeCreateDataHandle
901 (LPBYTE
)connection
->m_sendingData
,
902 connection
->m_dataSize
,
905 connection
->m_dataType
,
909 connection
->m_sendingData
= NULL
;
911 return (DDERETURN
)data
;
919 wxDDEConnection
*connection
= DDEFindConnection(hConv
);
923 wxString item_name
= DDEStringFromAtom(hsz2
);
925 DWORD len
= DdeGetData(hData
, NULL
, 0, 0);
927 wxChar
*data
= connection
->GetBufferAtLeast( len
);
928 wxASSERT_MSG(data
!= NULL
,
929 _T("Buffer too small in _DDECallback (XTYP_ADVDATA)") );
931 DdeGetData(hData
, (LPBYTE
)data
, len
, 0);
933 DdeFreeDataHandle(hData
);
934 if ( connection
->OnAdvise(connection
->m_topicName
,
938 (wxIPCFormat
) wFmt
) )
940 return (DDERETURN
)(DWORD
)DDE_FACK
;
944 return (DDERETURN
)DDE_FNOTPROCESSED
;
951 // ----------------------------------------------------------------------------
952 // DDE strings and atoms
953 // ----------------------------------------------------------------------------
956 static HSZ
DDEAddAtom(const wxString
& str
)
958 HSZ atom
= DDEAtomFromString(str
);
959 wxAtomTable
[str
] = atom
;
963 static HSZ
DDEGetAtom(const wxString
& str
)
965 wxAtomMap::iterator it
= wxAtomTable
.find(str
);
967 if (it
!= wxAtomTable
.end())
970 return DDEAddAtom(str
);
974 The returned handle has to be freed by the caller (using
975 (static) DDEFreeString).
977 static HSZ
DDEAtomFromString(const wxString
& s
)
979 wxASSERT_MSG( DDEIdInst
, _T("DDE not initialized") );
981 HSZ hsz
= DdeCreateStringHandle(DDEIdInst
, (wxChar
*)s
.wx_str(), DDE_CP
);
984 DDELogError(_("Failed to create DDE string"));
990 static wxString
DDEStringFromAtom(HSZ hsz
)
992 // all DDE strings are normally limited to 255 bytes
993 static const size_t len
= 256;
996 (void)DdeQueryString(DDEIdInst
, hsz
, wxStringBuffer(s
, len
), len
, DDE_CP
);
1001 static void DDEFreeString(HSZ hsz
)
1003 // DS: Failure to free a string handle might indicate there's
1004 // some other severe error.
1005 bool ok
= (::DdeFreeStringHandle(DDEIdInst
, hsz
) != 0);
1006 wxASSERT_MSG( ok
, wxT("Failed to free DDE string handle") );
1010 // ----------------------------------------------------------------------------
1012 // ----------------------------------------------------------------------------
1014 static void DDELogError(const wxString
& s
, UINT error
)
1018 error
= DdeGetLastError(DDEIdInst
);
1021 wxLogError(s
+ _T(": ") + DDEGetErrorMsg(error
));
1024 static wxString
DDEGetErrorMsg(UINT error
)
1029 case DMLERR_NO_ERROR
:
1030 err
= _("no DDE error.");
1033 case DMLERR_ADVACKTIMEOUT
:
1034 err
= _("a request for a synchronous advise transaction has timed out.");
1037 err
= _("the response to the transaction caused the DDE_FBUSY bit to be set.");
1039 case DMLERR_DATAACKTIMEOUT
:
1040 err
= _("a request for a synchronous data transaction has timed out.");
1042 case DMLERR_DLL_NOT_INITIALIZED
:
1043 err
= _("a DDEML function was called without first calling the DdeInitialize function,\nor an invalid instance identifier\nwas passed to a DDEML function.");
1045 case DMLERR_DLL_USAGE
:
1046 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.");
1048 case DMLERR_EXECACKTIMEOUT
:
1049 err
= _("a request for a synchronous execute transaction has timed out.");
1051 case DMLERR_INVALIDPARAMETER
:
1052 err
= _("a parameter failed to be validated by the DDEML.");
1054 case DMLERR_LOW_MEMORY
:
1055 err
= _("a DDEML application has created a prolonged race condition.");
1057 case DMLERR_MEMORY_ERROR
:
1058 err
= _("a memory allocation failed.");
1060 case DMLERR_NO_CONV_ESTABLISHED
:
1061 err
= _("a client's attempt to establish a conversation has failed.");
1063 case DMLERR_NOTPROCESSED
:
1064 err
= _("a transaction failed.");
1066 case DMLERR_POKEACKTIMEOUT
:
1067 err
= _("a request for a synchronous poke transaction has timed out.");
1069 case DMLERR_POSTMSG_FAILED
:
1070 err
= _("an internal call to the PostMessage function has failed. ");
1072 case DMLERR_REENTRANCY
:
1073 err
= _("reentrancy problem.");
1075 case DMLERR_SERVER_DIED
:
1076 err
= _("a server-side transaction was attempted on a conversation\nthat was terminated by the client, or the server\nterminated before completing a transaction.");
1078 case DMLERR_SYS_ERROR
:
1079 err
= _("an internal error has occurred in the DDEML.");
1081 case DMLERR_UNADVACKTIMEOUT
:
1082 err
= _("a request to end an advise transaction has timed out.");
1084 case DMLERR_UNFOUND_QUEUE_ID
:
1085 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.");
1088 err
.Printf(_("Unknown DDE error %08x"), error
);