Page 1 of 1

Anybody with success with NSLock ?

Posted: Mon Mar 05, 2007 3:49 pm
by Milan Mehta
Dear All,

Has anybody met success with NSLock ? I am using FWH May-2006 build and Win-Xp SP2. But my following code gives me GPF.


Can somebody help me ?

TIA
Milan.

-----------------------Cut-------------------------------
// FiveWin ActiveX support demo - Using Adobe Acrobat Reader

#include "FiveWin.ch"

function Main()

local oWnd, oActiveX, cLiberationKey := space(16)

DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

oActiveX = TActiveX():New( oWnd, "nslock15vb5.ActiveLock" )

oActiveX:Do( "Password" , "rochinha" )
oActiveX:Do( "SoftwareName" , "5Volution" )
oActiveX:Do( "LiberationKeyLength", 16 )
oActiveX:Do( "SoftwareCodeLength" , 16 )

//? oActiveX:GetProp( "SoftwareCode" )

if ! oActiveX:GetProp( "RegisteredUser" )
MsgGet( "Entre a chave de liberacao",; // Title
"Chave:",; // Label
@cLiberationKey ) // A variable by reference
oActiveX:Do( "LiberationKey", cLiberationKey )
endif

if ! oActiveX:GetProp( "RegisteredUser" )
if oActiveX:GetProp( "LastRunDate" ) > date()
? 'Data foi retrocedida. Programa sera encerrado'
else
? 'Faltam ' + Str( 30 - oActiveX:GetProp( "UsedDays" ) ) + ' dias.'
endif
? 'DEMONSTRACAO'
oWnd:cCaption := 'DEMONSTRACAO'
SysRefresh()
else
? 'REGISTRADO'
oWnd:cCaption := 'REGISTRADO'
SysRefresh()
endif

//oWnd:oClient = oActiveX // To fill the entire window surface

ACTIVATE WINDOW oWnd

return nil
-------------------------------------Paste----------------------------

Posted: Mon Mar 05, 2007 5:59 pm
by R.F.
The Sentinel Super Pro hardkey has a native (x)Harbour driver developed by ourselves.

It supports all the features of the lock using both, native C functions or the TSentinel Class.

Posted: Tue Mar 06, 2007 1:20 am
by Rochinha
Hello,

What GPF you found?

I test the example in a Windows Server 2003 and XP/ME in virtual PC.

Posted: Tue Mar 06, 2007 2:21 am
by Rochinha
This is the new code

Code: Select all

// FiveWin ActiveX support demo - Using Adobe Acrobat Reader

#include "FiveWin.ch"

function Main()

   local oWnd, oActiveX, cLiberationKey := space(16)

   DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

   oActiveX = TActiveX():New( oWnd, "nslock15vb5.ActiveLock" )

   oActiveX:SetProp( "Password", "rochinha" )
   oActiveX:SetProp( "SoftwareName", "5Volution" )
   oActiveX:SetProp( "LiberationKeyLength", 8 )
   oActiveX:SetProp( "SoftwareCodeLength" , 8 )

   if ! oActiveX:GetProp( "RegisteredUser" )
      MsgGet( "Entre a chave de liberacao",; // Title
              "Chave: ("+oActiveX:GetProp( "SoftwareCode" )+")",; // Label
              @cLiberationKey )              // A variable by reference
      oActiveX:SetProp( "LiberationKey", alltrim(cLiberationKey) )
   endif

   if ! oActiveX:GetProp( "RegisteredUser" )
      if oActiveX:GetProp( "LastRunDate" ) > date()
         ? 'Data foi retrocedida. Programa sera encerrado'
      else
         ? 'Faltam ' + Str( 30 - oActiveX:GetProp( "UsedDays" ) ) + ' dias.'
      endif
      ? 'DEMONSTRACAO'
      oWnd:cCaption := 'DEMONSTRACAO'
      SysRefresh()
   else
      ? 'REGISTRADO'
      oWnd:cCaption := 'REGISTRADO'
      SysRefresh()
   endif

   //oWnd:oClient = oActiveX // To fill the entire window surface

   ACTIVATE WINDOW oWnd 

return nil
Remember if you registered the .OCX in your system:

C:\WINDOWS\SYSTEM32\REGSVR32 C:\???\NSLOCK15VB5.OCX

Posted: Tue Mar 06, 2007 10:29 am
by Milan Mehta
Dear Rochina,

Thanks. It worked like that.

Where can I get information in English abt NSLock ? Does it generate different key for the different computer ?

TIA
Milan.

Posted: Tue Mar 06, 2007 10:31 am
by Milan Mehta
Dear RF,

Your www.google.com seems to be down today. I am not able to access it. Can you send me more information about Sentinel Super Pro ?

TIA
Milan.
RF wrote:The Sentinel Super Pro hardkey has a native (x)Harbour driver developed by ourselves.

It supports all the features of the lock using both, native C functions or the TSentinel Class.

Posted: Tue Mar 06, 2007 1:04 pm
by Rochinha
Milan

The last example work fine with NSLOCK15VB5.OCX. I made modifications to Activex SetProp/GetProp.

I found http://www.activelock.com with more informations about this .OCX.

Posted: Tue Mar 06, 2007 3:46 pm
by R.F.
Milan Mehta wrote:Dear RF,

Your www.google.com seems to be down today. I am not able to access it. Can you send me more information about Sentinel Super Pro ?

TIA
Milan.
The driver was developed for the Sentinel Company, it should be included with all the Sentinel Super Pro Developer Kits.

Posted: Wed Mar 07, 2007 5:23 am
by Milan Mehta
Dear Rochina,

I visited the site www.activelock.com. But it does not alllow me to register as new member. But anyway, they offer new version 1.8 also. Does that work too with xHarbour ? Let me know if you have experemented.

Does NSLock can work with pure xHarbour (no GUI) ?

TIA
Milan.