Version 2 of the code sent previously. byVal descriptors are unnecessary although RB accepts them.

Here is the code for using MachineID in RB. I use it as a method. To
test it as a demo (before receiving your own UserID and KeyCode),
comment out the MID_R call and include the MsgBox call, compile and
run in the same folder with the MachineID.dll file. You can use
different hardware to form the MachineID by changing the SetHardware
parameters.


Begin Method

   Declare Sub SetHardware Lib "MachineID" (HDD As integer, _
       CPU As integer, BIOS As integer )
   Declare Function GetMachineID Lib "MachineID" () As integer
   Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" _
       (hpvDest As integer, hpvSource As integer, cbCopy As integer )
   Declare Sub MID_R Lib "MachineID.dll" _
       (UserID As CString, LicenseKey As CString)

   Dim UID,LKey As String
   Dim m As new MemoryBlock(23)
   Dim addressBlock As new MemoryBlock(4)
   Dim theAddr As integer

   UID = "Your UserID"+chr(0)
   LKey = "Your LicenseKey"+chr(0)
   MID_R(UID,LKey)

   SetHardware(0,1,0)   ' UseHDD, UseCPU, UseBIOS

   addressBlock.Ptr(0) = m
   theAddr = addressBlock.Long(0)
   CopyMemory(theAddr,GetMachineID,24)

   'msgbox m.CString(0)

   return m.CString(0)

  End Method


Sorry for the noise.

Regards,

Art


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to