FIX: Error Message: Timeout While Waiting for DDE Response

Last reviewed: October 30, 1997
Article ID: Q95428
2.00 WINDOWS kbinterop kbprg kbbuglist

The information in this article applies to:

  • Standard and Professional editions of Microsoft Visual Basic programming system for Windows, version 2.0

SYMPTOMS

You can get the error "Timeout while waiting for DDE response" if you execute DDE commands within a DDE event. This occurs due to a limitation of the Dynamic Data Exchange Management Library (DDEML.DLL) that provides support for DDE under Windows. This problem may also occur if you place DDE commands in an event that is triggered by a DDE command such as the Change event of a text box.

CAUSE

The problem occurs because changing the text under the Destination Data section of the DDE source causes a Text1_Change event. Since this is a DDE related event, attempting to perform a DDE operation such as text2.LinkRequest results in the timeout error message.

WORKAROUND

To work around the problem, perform all DDE operations in non-DDE related events. If you need to perform a DDE operation in a DDE related event, you can put the DDE operations in a timer event that will execute after the DDE related event has finished. Here is an example:

  1. Follow steps 1 through 7 in the More Information section below.

  2. Place a timer control (Timer1) on Form1.

  3. Set the Interval property of Timer1 to 1.

  4. Set the Enabled property of Timer1 to False.

  5. In the Text1_Change event, enter the following code:

       Sub Text1_Change ()
          Timer1.Enabled = True
       End Sub
    
    

  6. In the Timer1_Timer event, enter the following code:

       Sub Timer1_Timer ()
          text2.LinkRequest
          Timer1.Enabled = False
       End Sub
    
    

  7. Run the program.

  8. Change the text in the Destination Data section of the compiled DDE sample application.

Text1 should correctly display the text typed into the Destination Data section of the compiled DDE sample application without producing an error.

STATUS

Microsoft has confirmed this to be a problem in the Standard and Professional editions of Microsoft Visual Basic version 2.0 for Windows. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Visual Basic, or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running.

  2. Open the DDE sample program located in the \SAMPLES\DDE directory.

  3. From the File menu, choose Make EXE File (ALT, F, K).

  4. Start the compiled .EXE program from Program Manager or File Manager.

  5. From the File menu, choose New Project (ALT, F, N). Form1 is created by default.

  6. Place two text boxes on Form1.

  7. In the Form_Load event, enter the following code:

       Sub Form_Load ()
    
          text1.LinkMode = 0
          text1.LinkTopic = "dde|system"
          text1.LinkItem = "txtdata"
          text1.LinkMode = 1  'Establish an automatic link
    
          text2.LinkMode = 0
          text2.LinkTopic = "dde|system"
          text2.LinkItem = "txtdata"
          text2.LinkMode = 2  'Establish a manual link
    
       End Sub
    
    

  8. In the Text1_Change event, enter the following code:

       Sub Text1_Change ()
          text2.LinkRequest
       End Sub
    
    

  9. Run the program.

  10. Change the text in the Destination Data section of the compiled DDE

        sample application.
    

After approximately five seconds, you will receive the error "Timeout while waiting for DDE response."


Additional reference words: buglist2.00 fixlist3.00 2.00 3.00
KBCategory: kbinterop kbprg kbbuglist
KBSubcategory: IAPDDE
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.