|
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...
- 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.
|
Creating DDE Server
- Create a new project "Project1"
- On Form1, set LinkMode="1 - Source"
- Set LinkTopic = "MyTopic"
- 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
- Create a new project "Project2"
- Add a textbox "Text1"
- 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
- Compile both projects.
- Start project1.exe first
- Start project2.exe (you must have project1.exe running or you will get an error)
- 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
|
Your Vote
|
| |
Other User Comments
|
3/4/2005 11:02:12 AM: EJ Smith
Nice code... 5 globes from me (If this comment was disrespectful, please report it.)
|
10/26/2006 2:56:33 PM: Aree
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.
|