如何 用VB实现DDE SERVER

monkst 2002-06-10 12:28:29
我按介绍上定的,设置了Form的linkTopic为"Fuild|Form1"(应用程序名为Fuild)设置LinkMode=1 运行后在Execl中设为"=Fuild|Form1!text1".可是总是出现以下错误:"链接不上远程数据,是否启动Fuild.exe",我点"确定"后出现:"fuild.exe不能运行,程序或程序的某一部份丢失。" 请问这是什么原因?在线等候,请帮忙。谢谢。
...全文
411 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
thinkeasy 2002-06-10
  • 打赏
  • 举报
回复
下面是个DDE的例子,你可能是没有设置LinkExecute
Private Sub Form_LinkExecute(CmdStr As String, Cancel As Integer)
Print CmdStr
Cancel = False '如果为TRUE 则客户端要出错
End Sub

Private Sub Form_Load()
' 否则在连接DDE程序时会出乱子的
If App.PrevInstance Then
Me.LinkTopic = "" ' 这两行用于清除新运行的程序的DDE服务器属性,
Me.LinkMode = 0
Picture1.LinkMode = 0 '--
Picture1.LinkTopic = "DDE|Form1" ' |______连接DDE程序并发送数据/参数
Picture1.LinkMode = 2 ' | “|”为管道符,是“退格键”旁边的竖线,
Picture1.LinkExecute "asd"

End ' 结束新程序的运行
End If
End Sub

thinkeasy 2002-06-10
  • 打赏
  • 举报
回复
Private Sub Form_LinkExecute(CmdStr As String, Cancel As Integer)
Print CmdStr
Cancel = False '如果为TRUE 则客户端要出错
End Sub

Private Sub Form_Load()
' 否则在连接DDE程序时会出乱子的
If App.PrevInstance Then
Me.LinkTopic = "" ' 这两行用于清除新运行的程序的DDE服务器属性,
Me.LinkMode = 0
Picture1.LinkMode = 0 '--
Picture1.LinkTopic = "DDE|Form1" ' |______连接DDE程序并发送数据/参数
Picture1.LinkMode = 2 ' | “|”为管道符,是“退格键”旁边的竖线,
Picture1.LinkExecute "asd"

End ' 结束新程序的运行
End If
End Sub
monkst 2002-06-10
  • 打赏
  • 举报
回复
谢谢,请查收分.
thinkeasy 2002-06-10
  • 打赏
  • 举报
回复
下面是服务器端的内容,LinkExecute是Form1的事件
Private Sub Form_LinkExecute(CmdStr As String, Cancel As Integer)
Print CmdStr'CmdStr是客户端交过的的字符串信息
Cancel = False '如果为TRUE 则客户端要出错,这是很重要的
End Sub
monkst 2002-06-10
  • 打赏
  • 举报
回复
你所写的例子我也看了,但没有看懂,这下我想请教一下
1 如何设置LinkExecute?
2 程序中Form_load中好像都是作为客户端的代码,作为服务端需要代码吗?对于DDE交换的控件能定制吗

7,788

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧