Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Windows DDE/DDE Client
This example is the version from Sun, 17th Mar 2012.
Project "DDE Client.xojo_binary_project"
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control service Inherits TextField
ControlInstance service Inherits TextField
End Control
Control topic Inherits TextField
ControlInstance topic Inherits TextField
End Control
Control connectbutton Inherits PushButton
ControlInstance connectbutton Inherits PushButton
EventHandler Sub Action()
dim a,b as DDEStringMBS
dim s as string
d=new DDEMBS
if d.InitClient then
s=service.text
if s<>"" then
a=d.newDDEString(s)
end if
s=topic.text
if s<>"" then
b=d.newDDEString(s)
end if
if d.ConnectToServer(a,b) then
msgBox "Connected."
connectbutton.enabled=false
disconnect.enabled=true
ExecuteButton.enabled=true
return // ok
else
msgBox "Failed to connect."
end if
d.close // failed
else
msgBox "Failed to initClient."
end if
End EventHandler
End Control
Control disconnect Inherits PushButton
ControlInstance disconnect Inherits PushButton
EventHandler Sub Action()
connectbutton.enabled=true
disconnect.enabled=false
ExecuteButton.enabled=false
d.close
d=nil
End EventHandler
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control execute Inherits TextField
ControlInstance execute Inherits TextField
End Control
Control ExecuteButton Inherits PushButton
ControlInstance ExecuteButton Inherits PushButton
EventHandler Sub Action()
dim s as DDEBinaryDataMBS
d.timeout=10000 // 10 Seconds
s=d.newDDEBinaryData(nil,execute.text)
if s<>nil then
if d.clientTransactionBoolean(d.XTYP_EXECUTE,nil,s) then
msgBox "Send okay."
else
msgBox "Send failed."
end if
else
msgBox "Can't make a DDE String."
end if
End EventHandler
End Control
EventHandler Sub Close()
// Clean up or RB will crash...
if d<>nil then
d.close
d=nil
end if
End EventHandler
Property Protected d As DDEMBS
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project
See also:
The items on this page are in the following plugins: MBS Win Plugin.