pursuited112
Posts: 10
Joined: Mon Jul 20, 2009 7:46 am

[Solved] How to do Licensing: Visual Basic 6 (code included)

I want to try the Licensing features that AI has to offer so I read the help and I read this thread.

I noticed it only had VB.NET and C# examples.

Does anyone have a VB6 example? If so, could you be kind to post that example.

I made a pretty sad attempt at it with this:
Public Declare Function InitTrial Lib "Trial.dll" (ByVal aKeyCode As String, aHwnd As Long) As Long
That is about it... Other than that I am completely stumped.

Could someone post a VB6 example of the functions and how to use it.

Thank you in advanced!
Last edited by pursuited112 on Wed Jul 22, 2009 1:22 pm, edited 3 times in total.
pursuited112
Posts: 10
Joined: Mon Jul 20, 2009 7:46 am

Re: Licensing: Visual Basic 6 | How to?

I was working with a buddy of mine and we figured it out by using this:

Declarations:

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 = "654654BB12AT1234D64FRY54T6POIK1ZZZ456Z765487E84BA123ALIV60SART12345678A09E4C"
How to use:

Code: Select all

Private Sub Form_Load()
    Call InitTrial(kLibraryKey, Me.hWnd)
End Sub
Hope this helps others out!
It would be a good idea to add this code snippet to the help files and to this thread. So the code snippet would be easier to find for those who use Visual Basic 6.
rzeegers
Posts: 2
Joined: Mon Jun 03, 2013 2:33 pm

Re: Licensing: Visual Basic 6 | How to?

pursuited112 wrote:I was working with a buddy of mine and we figured it out by using this:

Declarations:

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 = "654654BB12AT1234D64FRY54T6POIK1ZZZ456Z765487E84BA123ALIV60SART12345678A09E4C"
How to use:

Code: Select all

Private Sub Form_Load()
    Call InitTrial(kLibraryKey, Me.hWnd)
End Sub
Hope this helps others out!
It would be a good idea to add this code snippet to the help files and to this thread. So the code snippet would be easier to find for those who use Visual Basic 6.
@pursuited112 We cannot seem to get it to work in VB6 Do you have a simple vb6 example you can sent?

That would be a major help.

Cheers

Return to “Common Problems”