Will the framework allow a VB.NET form to be exposed via DDE

Oct 21, 2008 at 11:15 PM
We have a legacy app that supports interfacing with other apps via DDE.  We are looking at writing a small VB.NET app that will need to have data passed to its from via DDE from the Legacy application.  Is this possible or is this framework just for writing clients?
Dec 30, 2008 at 1:51 AM
Edited Dec 30, 2008 at 2:02 AM
NDde works well with VB.Net. I am using VB.Net Express Editions 2008 with NDde to retrieve real-time quotes from Metatrader Forex Client

Metatrader has a DDE server built, and the implementation to receive the quotes is straight forward. Best to have the VB.NET DDE client in it's own thread.

Here is sample for VB.NET Express 2008

' Thread that retrieves the market ticks and updates the history array

 

 

Private Sub DdeClientThread()

 

 

        Try

 

                  client =

New DdeClient(ddeService, ddeTopic, Me)

 

 

                 Try

 

                         client.Connect()

                         client.StartAdvise(value, 1,

True, 60000)

 

                         Debug.Print(

"DDE started for " & value & vbCrLf)

 

 

                        AddHandler client.Advise, AddressOf OnAdvise

 

 

                        While IsThreadActive = True

 

 

                                 Try

 

                                       System.Threading.Thread.Sleep(period * 1000)

 

                                Catch MyThreadError As ThreadInterruptedException

 

                                        IsThreadActive =

False

 

 

                                End Try

 

 

                       End While

 

 

                       If client.IsConnected() Then client.Disconnect()

 

 

                Catch ex As Exception

 

 

                      MsgBox(ex.Message & vbCrLf )

 

 

                End Try

 

 

         Catch NDdeX As NDde.DdeException

 

                 MsgBox(NDdeX.Message & vbCrLf)

 

         End Try

 

 

End Sub

 

 

'

 

 

' The DDE Callback function

 

 

'

 

 

Private Sub OnAdvise(ByVal sender As Object, ByVal args As NDde.Client.DdeAdviseEventArgs)

 

 

         Dim values() As String = args.Text.Split(" ")

 

 

        Dim param1, param2 As String

 

        param1 = values(0)

       param2 = values(1)

 

End Sub