DDEML connection fails after large number of calls

310 views Asked by At

Our Delphi 7 application communicates with the OpenOffice Calc DDE service, sOffice, using DDEML. It uses the service to read from a spreadsheet.

We've ran into a curious issue. After a large number of calls to 'DdeClientTransaction', the function returns a value of zero, indicating that it has failed. This failure is accompanied with the error 'DMLERR_NOTPROCESSED', which, according to http://www.opcdatahub.com/Docs/dhw-ax-windowsddeerrornumbers.html, means 'Receiving task was not interested in message'.

This is what we would expect to see if the DDE command was invalid. That is definitely not the case here. It happens after 16375 calls to 'DdeClientTransaction'. We can replicate this every time, over different spreadsheets.

To further confuse things, if we call DDEConnect after this failure, it returns a negative value. As far as we can tell, this is undocumented behavior. The function should return a positive handle or zero to indicate failure.

What's going on with the DDE connection and how do we fix it?

0

There are 0 answers