ID Number: Q83352
1.00
WINDOWS
buglist1.00
Summary:
The Microsoft Windows 3.0 operating system and Visual Basic version
1.0 limit the number of DDE hot links that you can send all at one
time.
This limitation occurs when you try to pass more than eight DDE links
all at one time from Visual Basic version 1.0 to Microsoft Excel
version 3.0. This limitation is demonstrated below.
The example below can be reproduced as a control array, but even with
a control array, the problem still exists.
Microsoft has confirmed this to be a problem in Microsoft Visual Basic
programming system version 1.0 for Windows. We are researching this
problem and will post new information here as it becomes available.
This information applies to Microsoft Visual Basic programming system
version 1.0 for Windows, to Microsoft Excel version 3.0 for Windows,
and to Microsoft Windows version 3.0.
More Information:
Steps to Reproduce Problem
--------------------------
1. Run Visual Basic, or from the File menu, choose New Project (ALT,
F, N) if Visual Basic is already running. Form1 is created by
default.
2. Place nine text boxes and four command buttons on Form1.
3. Place the following constants in the general Declarations section
of Form1:
Const hot = 1
Const cold = 2
4. In the Form_Load event procedure, place the following code:
Sub Form_Load ( )
z% = Shell("c:\excel\excel.exe c:\excel\server.xls", 1)
z% = DoEvents()
Text1.Text = "" '** Clear the text boxes
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text1.LinkMode = none
Text1.LinkTopic = "Excel|c:\excel\server.xls"
Text1.LinkMode = hot
Text1.LinkItem = "R1C1"
Text2.LinkMode = none
Text2.LinkTopic = "Excel|c:\excel\server.xls"
Text2.LinkMode = hot
Text2.LinkItem = "R1C2"
Text3.LinkMode = none
Text3.LinkTopic = "Excel|c:\excel\server.xls"
Text3.LinkMode = hot
Text3.LinkItem = "R1C3"
Text4.LinkMode = none
Text4.LinkTopic = "Excel|c:\excel\server.xls"
Text4.LinkMode = hot
Text4.LinkItem = "R2C1"
Text5.LinkMode = none
Text5.LinkTopic = "Excel|c:\excel\server.xls"
Text5.LinkMode = hot
Text5.LinkItem = "R2C2"
Text6.LinkMode = none
Text6.LinkTopic = "Excel|c:\excel\server.xls"
Text6.LinkMode = hot
Text6.LinkItem = "R2C3"
Text7.LinkMode = none
Text7.LinkTopic = "Excel|c:\excel\server.xls"
Text7.LinkMode = hot
Text7.LinkItem = "R3C1"
Text8.LinkMode = none
Text8.LinkTopic = "Excel|c:\excel\server.xls"
Text8.LinkMode = hot
Text8.LinkItem = "R3C2"
Text9.LinkMode = none
Text9.LinkTopic = "Excel|c:\excel\server.xls"
Text9.LinkMode = hot
Text9.LinkItem = "R3C3"
End Sub
5. Change the Command1 button caption to "Poke". In the Poke command
button, place the following code: (Notice that even with the
DoEvents function the problem still exists. You should also set the
caption on Command2 button to "Request".)
Sub Command1_Click ( ) '** Poke Button
Text1.LinkPoke
t% = DoEvents()
Text2.LinkPoke
t% = DoEvents()
Text3.LinkPoke
t% = DoEvents()
Text4.LinkPoke
t% = DoEvents()
Text5.LinkPoke
t% = DoEvents()
Text6.LinkPoke
t% = DoEvents()
Text7.LinkPoke
t% = DoEvents()
Text8.LinkPoke
t% = DoEvents()
Text9.LinkPoke
End Sub
6. Place the following code in the HOT command button after changing
the caption to HOT:
Sub Command3_Click ( ) '** HOT button
Command1.Enabled = -1 '** set Poke to TRUE
Command2.Enabled = 0 '** set Request to FALSE
End Sub
7. Place the following code in the COLD command button after changing
the caption to COLD:
Sub Command3_Click ( ) '**COLD button
Command1.Enabled = 0 '** set Poke to FALSE
Command2.Enabled = -1 '** set Request to TRUE
End Sub
8. Run the example by adding text to the nine text boxes and then
choosing the HOT button. The next step is to select the Poke
button, and about a minute later, you should receive the "Timeout
while waiting for DDE response" error on the "Text1.LinkPoke"
statement.
You can avoid this problem by changing one of the "Text.LinkMode =
hot" statements to "Text.LinkMode = cold".
You will NOT receive the "Timeout while waiting for DDE response"
error if you try nine cold links being sent all at one time.
Therefore, you can change all nine of the "Textx.LinkMode = hot"
statements to "Textx.LinkMode = cold" statements, then run the program
the same way as mentioned in step 7 above (selecting the HOT button
and Poke buttons still) without any error.
Additional reference words: 1.00 3.00