[ActiveLock-Development] CVS: alugen/app frmMain.frm,1.5,1.6
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2004-04-28 10:00:54
|
Update of /cvsroot/activelock/alugen/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10033 Modified Files: frmMain.frm Log Message: Fixed Type Mismatch error--see comments inside Index: frmMain.frm =================================================================== RCS file: /cvsroot/activelock/alugen/app/frmMain.frm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- frmMain.frm 18 Apr 2004 02:04:35 -0000 1.5 +++ frmMain.frm 28 Apr 2004 10:00:45 -0000 1.6 @@ -36,6 +36,7 @@ Object.Width = 17119 Text = "Ready" TextSave = "Ready" + Key = "" Object.Tag = "" EndProperty EndProperty @@ -469,8 +470,12 @@ ' The application will automatically recognize the license file the next time it starts up. ' 17.04.04 - th2tran - Saving to license file will not be safe because we can't update the LastUsed property ' (only the user app can do that). So instead, we save the liberation key to a file -' and provide the ability automatically register upon initialization, which is being handled +' and provide the ability automatically register upon initialization, which is being handled ' in the current IActiveLock implementation. +' 28.04.04 - th2tran - Normalize date format to YYYY/MM/DD to handle different regional settings. +' This fixes the "type mismatch error" encountered by IActiveLock_Register() when +' it tried to call CDate() on a date string of the format yyyy.mm.dd. +' ' </pre> ' /////////////////////////////////////////////////////////////////////// @@ -506,7 +511,7 @@ End If If cmbLicType = "Time Locked" Then lblExpiry = "&Expires on Date:" - txtDays = Format$(Now() + 30, "YYYY/MM/DD") + txtDays = ActiveLockDateFormat(Now() + 30) lblDays = "YYYY/MM/DD" Else lblExpiry = "&Expires after:" @@ -515,6 +520,13 @@ End If End Sub +'' +' Normalizes date format to yyyy/mm/dd +' +Private Function ActiveLockDateFormat(dt As Date) As String + ActiveLockDateFormat = Year(dt) & "/" & Month(dt) & "/" & Day(dt) +End Function + Private Sub cmbProds_Click() UpdateKeyGenButtonStatus End Sub @@ -631,7 +643,7 @@ ' Set Lic = ActiveLock2.CreateProductLicense(strName, "Code", strVer, alfSingle, varLicType, "Licensee", strExpire, "LicKey", "RegDate", "Hash1") ' Create a product license object without the product key or license key Dim strRegDate As String - strRegDate = Format(Now(), "yyyy/mm/dd") + strRegDate = ActiveLockDateFormat(Now()) Set Lic = ActiveLock2.CreateProductLicense(strName, strVer, "", alfSingle, varLicType, "", strExpire, , strRegDate) Dim strLibKey As String ' Pass it to IALUGenerator to generate the key @@ -667,7 +679,7 @@ If cmbLicType = "Time Locked" Then GetExpirationDate = txtDays Else - GetExpirationDate = Format$(Now + CInt(txtDays), "YYYY/MM/DD") + GetExpirationDate = ActiveLockDateFormat(Now + CInt(txtDays)) End If End Function |