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

article

DDE Client and DDE Server

Email
Submitted on: 6/4/2002 12:04:34 AM
By: Chui Tey 
Level: Beginner
User Rating: By 4 Users
Compatibility: VB 5.0, VB 6.0
Views: 25136
 
     Minimal (simple) VB DDE Server and Client using vbLinkAutomatic.

 
 
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.
				

Creating DDE Server

  1. Create a new project "Project1"
  2. On Form1, set LinkMode="1 - Source"
  3. Set LinkTopic = "MyTopic"
  4. Add Textbox called "txtSource"

You now have a DDE Server which publishes a topic called "Project1|MyTopic". The LinkItem name is "txtSource". It's hardwired to the name of the textbox control.

Creating a DDE Client

  1. Create a new project "Project2"
  2. Add a textbox "Text1"
  3. Add the following code:
Private Sub Form_Load()
 Text1.LinkMode = 0
 Text1.LinkTopic = "Project1|MyTopic"
 Text1.LinkItem = "txtSource"
 Text1.LinkTimeout = 100
 Text1.LinkMode = vbLinkAutomatic
 
End Sub

Test

  1. Compile both projects.
  2. Start project1.exe first
  3. Start project2.exe (you must have project1.exe running or you will get an error)
  4. Start typing into the textbox in project1 and see that it gets echoed in project2.


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
3/4/2005 11:02:12 AMEJ Smith

Nice code... 5 globes from me
(If this comment was disrespectful, please report it.)

 
10/26/2006 2:56:33 PMAree

Good code... 5 globes from me
I test the code for my computer and it works fine.
I want to ask if I want to run this code over network (Local Area Network), what shoud I change in the code, or what should I change of the network setting.
Thanks,
Best regards.
(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.