HASPHLDMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

HASPHLDMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Dongle MBS Dongle Plugin 11.1 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
A class for accessing HASP HL or Sentinel dongles.
Example
// Load your vendor library or the demo one
dim LibFile as FolderItem = GetFolderItem("hasp_darwin_12345.dylib")

if HASPHLDMBS.LoadLibrary(LibFile) then
'MsgBox "OK"
else
MsgBox "Failed to load library."
Return
end if

// init dongle
' This method runs the actual tests on the given program number
dim blob as MemoryBlock // container for data for en-/decryption

dim FeatureID = HASPHLDMBS.HASP_DEFAULT_FID
dim VendorCode = "123456" // your vendor code here, some big Base64 encoded block

dim hasp as new HASPHLDMBS(FeatureID, VendorCode)
Select case hasp.Lasterror
case HASPHLDMBS.HASP_STATUS_OK
// ok
case HASPHLDMBS.HASP_HASP_NOT_FOUND
MsgBox "Dongle not found."
return
case HASPHLDMBS.HASP_INV_VCODE
MsgBox "Invalid vendor code"
Return
else
MsgBox "Error: "+str(hasp.Lasterror)
return
end Select

// read a file ID
dim fileid as Integer = 65524
dim size as Integer = hasp.GetSize( fileid )

if hasp.Lasterror = HASPHLDMBS.HASP_STATUS_OK then // ONLY IF FILE IS SUPPORTED

// read to memoryblock
blob = hasp.ReadMemory( fileid, 0, size )
if hasp.Lasterror = HASPHLDMBS.HASP_STATUS_OK then
// show in MsgBox
s = Blob.stringvalue(0,blob.size)
MsgBox DefineEncoding(s,Encodings.UTF8)
end if
end if

Please use HASP Master Wizard Suite to generate your own runtime libraries. Than you get a couple of DLLs which you can load with this class. For the demo keys, you can use the demo DLLs.
The demo DLL for example is named "hasp_windows_x64_demo.dll" or including your vendor code "hasp_windows_x64_12345.dll" (64bit). 32bit Windows DLL is named hasp_windows_12345.dll, hasp_windows_demo.dll or haspvlib_12345.dll.

Now when you have the platform dependent libraries, you can use LoadLibrary() function in this class to load the right one.

HASPHLMBS uses a linked in library. This is okay for older HASP HL versions. But newer versions require you to create your own signed libraries. For them use the HASPHLDMBS class.

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes


The items on this page are in the following plugins: MBS Dongle Plugin.


GZipFileMBS   -   HIDAPIDeviceInfoMBS


💬 Ask a question or report a problem