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

DDEConnect Method hanging

Hi,

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?

Thanks
0
StanChart
Asked:
StanChart
1 Solution
 
topdog770Commented:
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.


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/dataexchange/dynamicdataexchangemanagementlibrary/dynamicdataexchangemanagementreference/dynamicdataexchangemanagementfunctions/ddeclienttransaction.asp

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.

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

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