Platforms to show: All Mac Windows Linux Cross-Platform

/Dongle/HASP/HASP Dongle easy
Function:
Required plugins for this example: MBS Util Plugin, MBS Dongle Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Dongle/HASP/HASP Dongle easy
This example is the version from Sun, 17th Mar 2012.
Project "HASP Dongle easy.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control edit Inherits TextArea
ControlInstance edit Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() write End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() read End EventHandler
End Control
Control Pass1 Inherits TextField
ControlInstance Pass1 Inherits TextField
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control Pass2 Inherits TextField
ControlInstance Pass2 Inherits TextField
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control Status Inherits Label
ControlInstance Status Inherits Label
End Control
Protected Sub read() dim m as MemoryBlock dim s as string dim p1,p2,p3,p4 as integer m=NewMemoryBlock(1024) p1=0 p2=248 // Just read everything, 248 words = 496 bytes CallHASPMemMBS 50,0,0,val(pass1.text),val(pass2.text),p1,p2,p3,p4,m if p3=0 then status.text="ok" // just get the string with the encoding s=m.CString(20) SetEncodingOfStringMBS s,m.Long(12) edit.Text=s else status.text="error "+str(p3)+" "+GetHASPErrorStrMBS(p3) end if End Sub
Protected Sub write() dim m as MemoryBlock dim l as integer dim s as string dim p1,p2,p3,p4 as integer s=edit.text l=lenb(s) // Fill memoryblock m=NewMemoryBlock(1024) m.Long(0)=0 // year m.Long(4)=0 // month m.Long(8)=0 // day m.Long(12)=GetEncodingOfStringMBS(s) m.Long(16)=0 // checksum for string? m.CString(20)=s // Offset=0 and Size in words: p1=0 p2=l\2+11 // one more for string end byte CallHASPMemMBS 51,0,0,val(pass1.text),val(pass2.text),p1,p2,p3,p4,m if p3=0 then status.text="ok" else status.text="error "+str(p3)+" "+GetHASPErrorStrMBS(p3) end if End Sub
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu0 = "-"
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 Dongle Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...