FIX: Invalid Page Fault Occurs with More Than 34 DDE ChannelsID: Q180624
|
The following error message is displayed if you attempt to open more than
34 DDE (Dynamic Data Exchange) channels:
VB5 caused an invalid page fault in module KRNL386.EXE at 0002:000033C6
Use OLE automation instead of DDE. OLE automation is the current and future
support technology at Microsoft. For more information about OLE automation
see the following:
This problem has been fixed in Microsoft Windows 98.
The number of DDE channels required to reproduce this problem varies by
machine and configuration and is not predictable. This behavior occurs in
as few as 34 channels to as many as 72 channels.
The next section shows how to create a sample project that demonstrates
this behavior. In order to observe the behavior, you need to create an
Excel spreadsheet to act as a server.
Option Explicit
Const MAX_CONNECTIONS = 98
Private Sub Form_Load()
'Creates a grid composed of labels.
Dim i As Integer
Dim n As Integer
Dim j As Integer
Dim temptop As Integer
Dim templeft As Long
templeft = 120
temptop = 120
' Set initial properties of label used as template for dynamically
' created labels.
Label1(0).BorderStyle = 1
Label1(0).Caption = ""
Label1(0).Visible = False
Label1(0).Move 120, 120, 1200, 300
' Size form to handle array of MAX_CONNECTIONS labels and other
' controls.
Me.Height = (Label1(0).Height * 14) + (60 * 15) + 980
Me.Width = (Label1(0).Width * 7) + (60 * 8) + 200
Me.Caption = "DDE Connection Limit Test"
'Set initial properties of Command1.
Command1.Caption = "Number of DDE connections"
Command1.Move 1420, Me.Height - 920, 4800, 400
Command1.Default = True
'Set initial properties of Text1.
Text1.Text = ""
Text1.Move 120, Command1.Top, 1200, Command1.Height
'Two nested For loops create grid of labels.
For i = 1 To 14 'Outer loop moves down the form,
For j = 1 To 7 'inner loop moves across the form.
n = n + 1 'supplies you with array index.
Load Label1(n)
Label1(n).Visible = True
Label1(n).Top = temptop
Label1(n).Left = templeft
templeft = templeft + Label1(0).Width + 60
Next j
templeft = 120
temptop = temptop + Label1(0).Height + 60
Next i
Me.Show
Text1.SetFocus
End Sub
Private Sub Command1_Click()
Dim iValue As Integer
Dim i As Integer
'Get the value entered by the user.
iValue = Val(Text1)
'Test for invalid value.
If iValue < 1 Or iValue > MAX_CONNECTIONS Then
MsgBox "Enter a number between 1 and " & MAX_CONNECTIONS
Exit Sub
End If
'Remove any existing connections and reset all captions.
For i = 1 To MAX_CONNECTIONS
Label1(i).LinkMode = vbLinkNone
Label1(i).Caption = ""
Next i
'Start DDE conversations for the chosen number of labels.
For i = 1 To iValue
Label1(i).LinkTopic = "EXCEL|Book1.xls"
Label1(i).LinkItem = "R1C1"
Label1(i).LinkMode = vbLinkAutomatic
Next i
End Sub
Additional query words:
IPF GPF Crash Dynamic Data Exchange DDE Link kbVBp400 kbVBp500
kbVBp kbInterop kbOSWin98fix kbVBp600
Keywords :
Version : WINDOWS:4.0,5.0,6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 21, 1999