I have a big problem using the TRIAL option of the Licensing Tool:
I am using VB and integrated the example lines from the Advaced Installer help exactly as shown. But If i build this example in VB 2008 I get the following error message, even if I load and build the examle from the AI Help!
Error The command "call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "C:\TrialVB\bin\Release\test.exe"" exited with code 9009. test
What is wrong?
This is the error at the original VB Example file from the Advanced Installer help:
Error The command "call "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "C:\Trial Test Example\TrialTestExample.NET\TrialVB\bin\Release\TrialVB.exe"" exited with code 9009.
TrialVB
This is my VB code:
Code: Select all
Imports System.Runtime.InteropServices
Public Class Form1
' This function does all the work
<DllImport("Trial.dll", EntryPoint:="ReadSettingsStr", CharSet:=CharSet.Ansi)> _
Private Shared Function InitTrial(ByVal aKeyCode As String, ByVal aHWnd As IntPtr) As UInteger
End Function
' Use this function to register the application when the application is running
<DllImport("Trial.dll", EntryPoint:="DisplayRegistrationStr", CharSet:=CharSet.Ansi)> _
Private Shared Function DisplayRegistration(ByVal aKeyCode As String, ByVal aHWnd As IntPtr) As UInteger
End Function
' The kLibraryKey is meant to prevent unauthorized use of the library.
' Do not share this key. Replace this key with your own from Advanced Installer
' project > Licensing > Registration > Library Key
Private Shared kLibraryKey As String = "8DC6A1A385468B3D13EDB3B1AA359184F8DC6A1A385468B3D13EDB3B1AA359184F"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim Proc As Process = Process.GetCurrentProcess()
InitTrial(kLibraryKey, Proc.MainWindowHandle)
Catch ex As DllNotFoundException
MessageBox.Show(ex.ToString())
Process.GetCurrentProcess().Kill()
End Try
End Sub
Private Sub RegisterBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RegisterBtn.Click
Try
Dim Proc As Process = Process.GetCurrentProcess()
DisplayRegistration(kLibraryKey, Proc.MainWindowHandle)
Catch ex As DllNotFoundException
MessageBox.Show(ex.ToString())
Close()
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Close()
End Sub
End Class
call "$(DevEnvDir)..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "$(C:\Trial Test Example\TrialTestExample.NET\TrialVB\bin\Release\TrialVB.exe)"
The following generated the same error:
call "$(DevEnvDir)..\Tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "$(TargetPath)"
What is the right syntax. I think the problem is right there ...
Please help me!!!
FOLLOW US