This snippet shows how a DDE client can update data on a DDE Server.
Terms of Agreement:
By using this article, you agree to the following terms...
You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
You may link to this article from another website, but ONLY if it is not wrapped in a frame.
You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Write the VB DDE server
Create VB project "Project1"
Set Form1.LinkMode="1 - Source"
Set Form1.LinkTopic="MyTopic"
Add Textbox called "txtDestination"
Write the VB DDE Client
Create VB project "Project2"
Add Textbox called "Text1"
Add the following code to the form
Option Explicit
Private Sub Form_Load()
With Text1
.LinkMode = 0
.LinkTopic = "Project1|Crash"
.LinkItem = "txtSource"
.LinkMode = vbLinkManual
End With
End Sub
Private Sub Text1_Change()
With Text1
.LinkPoke
End With
End Sub
Test your program!
Launch project1
Launch project2
Start typing into the textbox in project2
You should see the textbox in project1
getting updated.
Just out of curiousity, do both applications have to reside on the same machine??
Thanks...
(If this comment was disrespectful, please report it.)
8/7/2004 8:02:54 AM:
OOops it doesn't work for me - have I got a setting wrong ?
I get Run time error 282 no foreign appllication responded to a DDE initiate and yes I did start Project1 first - both in vb and in compiled form (If this comment was disrespectful, please report it.)
theres an error when i ran project 2 it says no foreign application responded to a DDE initiate, but i ran both project 1 first then project 2, whats seems to be the problem? (If this comment was disrespectful, please report it.)
Add Your Feedback
Your feedback will be posted below and an email sent to
the author. Please remember that the author was kind enough to
share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular article, please
click here instead.)