Check the CHMlicenseControl checkbox as shown below.
VB Components Menu
Add a CHMlicense object to your project (e.g. CHMlicense1).
VB Form
Use the following code (or something similar) to use the object:
PrivateSub Command1_Click()
OnErrorGoTo HandleError 'Set up error handler.
Dim MachineId AsStringDim RegistrationCode AsStringIf CHMlicense1.isLicensed Then
MsgBox "Machine Is Licensed"Else
MsgBox "Machine Is NOT Licensed"EndIf
MachineId = CHMlicense1.MachineId
MsgBox "Machine ID is " + MachineId
'Set a proxy if required.
'CHMlicense1.Proxy = "webproxy.acme.com".
'Fetch the registration code.
RegistrationCode = CHMlicense1.FetchRegistrationCode(MachineId, "your.name@yourcompany.com", "password01", "My Development Code")
MsgBox "Registration Code: " + RegistrationCode
ExitSub'Quit so error handler doesn't get run.
HandleError:
MsgBox Err.Description, vbCritical, "Machine Registration Error"EndSub