• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 444
  • Last Modified:

DDEConnect Method hanging


I use DDE to get updates from another application.  Sometimes, when my application closes, the DDE connection with the server is not closed properly.  In these cases, my application is still subscribed to receive updates.  If I try to connect again, my application hangs when using the method ::DdeConnect() . I presume it hangs because the server already thinks my application is registered to receive updates.  Is there anyway I can check to see whether my application is already registered on the DDE server?  If so, how can I terminate it?

1 Solution
With MFC applications, there can be more then one path an application can follow when being shutdown.  

It sounds as though your Dde transactions, connections, etc ( DdeDisconnect, DdeUnitialize, etc ) are not always being called, so you may need to verify that all closing 'paths' allow the Dde connection to be closed and any current transactions be abandoned before your application closes.  Look at DdeAbandonTransaction also.

There is a DMLERR_REENTRANCY  value returned from the DdeGetLastError function that indicates another conversion is already
taking place.


Please feel free to respond with any questions, I realize this posting is not as complete as it could be.

I think your best course of correction is to ensure that the Dde conversation is closed from your application.

You could try 'DdeQueryConvInfo()' to check whether a DDE conversation is established.
Try using the Kill Statemment to shutdown the dde server before calling again

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now