kleinkiesling
Posts: 2
Joined: Mon Mar 26, 2012 5:53 am

Problem in applying trial (VB 6)

I have some problem regarding applying trial to my software. It is applied and running during installation, but when the set limit is reached (i.e. 10 uses) the program is still going, defeating the purpose of the trial. Here is my code

Code: Select all

Private Declare Function InitTrial Lib "Trial.dll" Alias "ReadSettingsStr" ( _
ByVal aCode As String, _
ByVal aHWnd As Long _
) As Long
Private Const kLibraryKey As String = "B5DBA08A9A818167DEAE1C676752D264A1377B9CA0274F7B0B94CA06C8F1E777609F6FE4917A"


Private Sub Form_Load()
Call InitTrial(kLibraryKey, Me.hWnd)
Dim objWMIService, colProcesses
Set objWMIService = GetObject("winmgmts:")
Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process where name='" & Process & "'")
If colProcesses.Count Then
Shell "C:\Program Files\iTBoard\a.exe"
Else
Shell "C:\Program Files\iTBoard\b.exe"
Shell "C:\Program Files\iTBoard\a.exe"
End If
Unload Me
End Sub
Could somebody enlighten me or fix my error? Thank you in advance.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problem in applying trial (VB 6)

Hi and welcome to Advanced Installer forums,

Did you try to follow our "Integrate licensing feature in VB projects" tutorial? It should work for VB6 applications.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kleinkiesling
Posts: 2
Joined: Mon Mar 26, 2012 5:53 am

Re: Problem in applying trial (VB 6)

I did, but unfortunately I cannot integrate the script on the tutorial page into my project (my VB6 protested the syntax error). Using my code I can get it to recognize the trial at the beginning, but the program cannot be halted when the trial period is expired, nor it display trial warning messages even when I set it to appear every time the program runs. Was it because I just plainly integrate the .dll or is there something I missed? Thank you for your kind attention.
CiprianComsa
Posts: 110
Joined: Thu Aug 19, 2010 10:11 am
Contact: Website

Re: Problem in applying trial (VB 6)

Hi,

The Import Visual Studio project feature does not support Visual Basic 6. The sample code from our tutorial is for Visual Basic .NET application (please adapt your Visual Basic 6 code according with our sample code from our tutorial).
You can follow the steps from tutorial but import your VB6 sources by selecting Visual Basic 6.0 Project Type from our installer.

Regards,
Ciprian
__________________________________________________________________________________________________________________________________________________
Ciprian Comsa
Advanced Installer Team
http://www.advancedinstaller.com/
Ciprian Comsa - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”