Important alert: (current site time 7/16/2013 12:59:46 AM EDT)
 

article

DDE (pushing data from client to server)

Email
Submitted on: 6/4/2002 12:31:48 AM
By: Chui Tey 
Level: Beginner
User Rating: By 1 Users
Compatibility: VB 5.0, VB 6.0
Views: 19753
 
     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...   
  1. 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.
  2. 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.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. 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

  1. Create VB project "Project1"
  2. Set Form1.LinkMode="1 - Source"
  3. Set Form1.LinkTopic="MyTopic"
  4. Add Textbox called "txtDestination"

Write the VB DDE Client

  1. Create VB project "Project2"
  2. Add Textbox called "Text1"
  3. 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!

  1. Launch project1
  2. Launch project2
  3. Start typing into the textbox in project2
  4. You should see the textbox in project1 getting updated.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/5/2002 7:35:14 AMJigglestheclown

Well Done, Almost Useless, but Well Done
(If this comment was disrespectful, please report it.)

 
10/7/2003 11:13:13 AMTim Roop

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.)

 
10/25/2006 9:00:02 PMrico

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.)
 

To post feedback, first please login.