Sorry, but I'm not good enough in DDE-issues. In C++ I monitor the orderStatus callback. It is call from the TWS each time the status or the 'fillstatus' of an order changes. So it is quite simple to keep track of the open orders.
Quote from Toland:
I found, that IB API can marked
partially filled orders as it want:
sometimes it "filled", sometimes "canceled", etc.
The best way to handle this situation is to
check all orders for order.remaining and order.filled parameters.
if ( order.remaining > 0 ) and
( order.filled > 0 ) then
Do something