You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Filemapping/Shared Memory Client
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
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 Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action()
dim m as MemoryBlock = v.Memory
if m<>Nil then
StaticText2.text = DefineEncoding(m.CString(0), encodings.UTF8)
else
StaticText2.text = "n/a"
end if
End EventHandler
End Control
EventHandler Sub Open()
s = new FileMappingMBS
if s.OpenSharedMemory("mbstest") then
// ok
v = s.MapView(0, 5000)
if v = nil then
MsgBox "Failed to map shared memory region."
quit
end if
else
MsgBox "Failed to create shared memory region."
quit
end if
End EventHandler
Property s As FileMappingMBS
Property v As FileMappingViewMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar