This project is read-only.

The client failed to connect !!

Jul 22, 2013 at 4:30 AM
In excel, the following is ok.

========= By using NDde and ==========

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    mytopic.AddRange(New String() {"2330", "2498"})  'stock id
    myitem.AddRange(New String() {"price"})
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    topicCount = mytopic.Count - 1
    ReDim myClient(topicCount)
    For i As Integer = 0 To topicCount
        myClient(i) = New DdeClient("YES|DQ!", mytopic.Item(i).ToString, Me)

            If i = topicCount Then
                Me.GroupBox1.Text = "Connect success"
                Me.Button1.Enabled = False
            End If
        Catch ex As Exception
            If ex.GetType.ToString = "System.InvalidOperationException" Then
                Me.Button1.Enabled = False
                Me.Button1.Enabled = True
            End If
        End Try
End Sub

The error is as follow:

The client failed to connect to "YES|DQ!|2330". Make sure the server application is running and that it supports the specified service name and topic name paire.
Aug 13, 2013 at 11:54 AM
hi - i think you need to instantiate the DDE Client like this:-

myClient(i) = New DdeClient("YES", "DQ", Me)

and then request the item like this:-