Specifications

Appendix A
A-8
PYTHON
3. Failure to handle errors when using synchronous transactions.
DDE is an asynchronous process, but is made to appear synchronous
when the message sender chooses to suspend execution while waiting for
a r
eply. If the timeout period specified is not long enough, the transaction
will appear to have failed. Further problems may arise when the message
from the server finally arrives. A much better way is to work
asynchronously, a callback routine is entered when the partner application
replies.
So far, the ddeclt module does only provide synchronous operations. The
Python interpreter's callback mechanism was not suitable yet, limiting
callback requests to a fixed 32 (see
Py_AddPendingCall()
). Y
ou can,
however, use an Advise link to receive asynchronously and use the
CrossView Pro command execnowait: to emulate asynchronous
execution.
5.1 DDE CLIENT METHODS
ProcessAllPendingMessages(first_msg = 0, last_msg = 0)
Process (pump) all waiting messages for the current thread.
Retur
ns 1 if a WM_QUIT event was r
eceived, 0 otherwise.
WaitForAndProcessOneMessage()
Process (pump) one waiting message for the current thr
ead. It is necessary
for a DDE client to process events, to service the Advise link. This function
is useful when using a custom DDE callback function in Python. See
Initialize().
Retur
ns 1 if a WM_QUIT event was r
eceived, -1 in case of error, 0
otherwise.