DDE闂(瀹㈡埛绔拰鏈嶅姟绔氨鏄繛鎺ヤ笉涓婏紝璇烽珮鎵嬫寚鐐广€?

wujingyi88888 2006-01-24 08:54:29
DDE闂锛氬鎴风鍜屾湇鍔$灏辨槸杩炴帴涓嶄笂锛岃楂樻墜鎸囩偣銆?
瀹㈡埛绔唬鐮侊細
Private Sub Form_Load()
Text1.LinkTopic = "鏈嶅姟宸ョ▼|DDE_Text"
Text1.LinkItem = "txtserver"
Label2.LinkTopic = "鏈嶅姟宸ョ▼|DDE_Text"
Label2.LinkItem = "clock"

Retry:
On Error GoTo Handle
Label2.LinkMode = 1
Cmdreq.Enabled = False
cmdUpdate.Enabled = True

Handle:
If Err = 282 Then
Dim x
Dim Fname As String

Fname = App.Path + "\鏈嶅姟宸ョ▼.exe"
x = Shell(Fname, vbNormalFocus)
Exit Sub
Resume Retry
Else
Error Err
Exit Sub
End If
End Sub

Private Sub Option1_Click(Index As Integer)
Select Case Index
Case 0
Text1.LinkMode = 1
Cmdreq.Enabled = False
Label1.Caption = "璁剧疆浜嗚嚜鍔ㄦ柟寮?
Case 1 'Manual
Text1.LinkMode = 2
Cmdreq.Enabled = True
Label1.Caption = "璁剧疆浜嗘墜鍔ㄦ柟寮?
Case 2 ' Notify
Text1.LinkMode = 3
Cmdreq.Enabled = False
Label1.Caption = "璁剧疆浜嗛€氱煡鏂瑰紡"
Case 3
Text1.LinkMode = 0
Cmdreq.Enabled = False
cmdUpdate.Enabled = False
Label1.Caption = "DDE瀵硅瘽缁撴潫"
End Select
End Sub

Private Sub Text1_LinkNotify()
Label1.Caption = "鏁版嵁宸叉敼鍙橈紝璇锋寜[鏇存柊]鎸夐挳鎺ュ彈鏂版暟鎹紒"
cmdUpdate.Enabled = True
End Sub

Private Sub Cmdreq_Click()
Text1.LinkRequest
End Sub

Private Sub cmdUpdate_Click()
Text1.LinkRequest
cmdUpdate.Enabled = False
End Sub

Private Sub Text1_LinkError(LinkErr As Integer)
MsgBox "DDE閾炬帴閿欒锛?
End Sub
鏈嶅姟绔唬鐮侊細
Private Sub cmdExit_Click()
End
End Sub

Private Sub Form_Load()
TxtServer.Text = " 濂冲+浠紝鍏堢敓浠紝璇锋敞鎰忥紒 鏈湇鍔″櫒灏嗗彂甯冩渶鏂版秷鎭€?
End Sub
Private Sub Timer1_Timer()
Clock.Caption = Time$
End Sub
...全文
33 点赞 收藏 4
写回复
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sky9705 2006-01-25
明眼人一看就知道这是DDE控制不同应用程序之间传递参数的问题。。。。不过我不会哦
回复
乱码哦
回复
foreverstar2004 2006-01-25
全乱码??啥意思楼主??
回复
faysky2 2006-01-24
?
回复
发动态
发帖子
VB基础类
创建于2007-09-28

7453

社区成员

VB 基础类
申请成为版主
社区公告
暂无公告