In VB DDE, LinkRequest "Unexpected Error: Quitting"

ID Number: Q79387

1.00

WINDOWS

buglist1.00

Summary:

While performing a DDE LinkRequest between two Visual Basic

applications, an "Unexpected Error: quitting" message will be

displayed under the following conditions:

- The DDE conversation is established from a label control or text

box in the client application.

- The DDE conversation is established to a text control in the server

application.

- The server application text box is assigned the result of a string

operation where the string operation involves the text property of

the text box (such as: Text1.Text = Text1.Text + "Hello world").

- The amount of text in the server application text box exceeds 32K.

- A LinkRequest is performed from the client application to obtain

information in the text box of the server application.

Microsoft has confirmed this to be a problem in the 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.

More Information:

Steps to Reproduce Problem

--------------------------

Part 1: Creating the Client Application

---------------------------------------

1. Run Visual Basic or choose New Project from the File menu if

Visual Basic is already running. Form1 will be created by

default.

2. Change the LinkTopic property of Form1 to Null.

3. Change the LinkMode property of Form1 to None (0).

4. Place a label control (Label1) on Form1.

5. Place the following code in Form1's Click event procedure:

Sub Form1_Click ()

Label1.LinkMode = 0

Label1.LinkTopic = "Project1|Form1"

Label1.LinkItem = "Text1"

Label1.LinkMode = 2 'Establish a cold link

End Sub

6. Place the following code in Label1's Click event procedure:

Sub Label1_Click ()

Label1.LinkRequest

End Sub

7. From the File menu, choose Make EXE File (ALT, F, K) to create

PROJECT1.EXE.

8. Choose OK from the Make EXE File dialog box.

Part 2: Creating the Server Application

---------------------------------------

1. From the File menu, choose New Project (ALT F, N).

2. Select No in response to the "Save changes to Form1" prompt.

3. Select No in response to the "Save changes to Project1" prompt.

Form1 will be created by default.

4. Place a text box (Text1) on Form1.

5. Change the MultiLine property of Text1 to True.

6. Place the following code in the Form1_Click event procedure.

Sub Form1_Click ()

Text1.Text = ""

For i = 1 to 320

Text1.Text = Text1.Text + String$ (98, "a") + Chr$(13) +

Chr$(10)

Next i

End Sub

7. From the Run menu, choose Start (ALT, R, S).

8. Click inside Form1 to begin filling the text box with 32,000 "a"s.

Note: This process may take a few minutes.

9. After the Form1_Click event procedure has finished executing,

choose Break from the Run menu.

Part 3: Establishing the DDE Link

---------------------------------

1. From the Program Manager File menu, choose Run (ALT, F, R).

2. From the Run dialog box, type in the full path and filename to the

location of the file created in Part 1 (Project1.EXE) and choose OK.

Form1 for PROJECT1.EXE should appear on the screen.

3. Click Form1 of PROJECT1.EXE (this will initialize the DDE

conversation between PROJECT1.EXE and the project running inside of

the Visual Basic environment).

4. Click Label1 in Project1.

5. In the Visual Basic Immediate window, type the following code on

one line:

For i = 1 to 10 : Text1.Text = Text1.Text + String$(98, "a")

+ Chr$(13) + Chr$(10) : Next i

Note: This will add an additional 10,000 bytes to the text box,

bringing the total to 33,000 bytes.

6. In Project1.EXE, click Label1 again.

The "Unexpected Error : quitting" error will occur and Visual Basic

will shut down.

Additional reference words: 1.00