A basic DDE Server that accepts LinkExecute commands
Demonstrates how to write a VB DDE Server that accepts DDEExecute command.
Original Author: Chui Tey
Code
VB DDE Server Run the project VB DDE Client We'll now code up a client that calls DDE Execute on the server. Testing Run the project. When the form appears click on the button. Comments DDE is a mechanism that is supported by a lot of applications. It can only handle simple strings, and is not as flexible or powerful as COM. However, some older applications only support DDE, and it is still necessary to code Note on link topic The link topic by default is the EXE name.
Option Explicit
Private Sub Form_LinkExecute(CmdStr As String, Cancel As Integer)
MsgBox "Received " & CmdStr, vbInformation
Cancel = False
End Sub
Option Explicit
Private Sub Command1_Click()
Text1.LinkMode = vbLinkNone
Text1.LinkTopic = "Project1|SYSTEM"
Text1.LinkMode = vbLinkManual
Text1.LinkExecute "Hello World"
End Sub
Notice that the VB DDE Server has received
a string from the client and shown it on a
textbox.
DDE Servers.
However, you can change this in the VBP file,
if you have a look at the key TITLE="...", this
key can be modified to use a different link topic.
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.