Dear AdvancedInstaller team
I want to know if i understand well about Trail setup or there is something missing or unclear to me.
-We have C# application
- From page Trail & Registration -> New Trail -> define a new Trail -> complete the forms
- A new DLL (Trialware.dll) created
- Add this DLL to my project
- Add this code in load phase :
// This function does all the work
[DllImport("Trial.dll", EntryPoint = "ReadSettingsStr", CharSet = CharSet.Ansi)]
static extern uint InitTrial(String aKeyCode, IntPtr aHWnd);
// Use this function to register the application when the application is running
[DllImport("Trial.dll", EntryPoint = "DisplayRegistrationStr", CharSet = CharSet.Ansi)]
static extern uint DisplayRegistration(String aKeyCode, IntPtr aHWnd);
-But when we ready to include the (Trailware.dll) to our project , it gives assemply error
-Also this code, where we shall add?
// 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 const string kLibraryKey = "177291AA00FE97A4A15EDE12F5FEEE6AEF848E711477E84BA999DEAD60CADA84313821C09E4C";
private static void OnInit()
{
try
{
Process process = Process.GetCurrentProcess();
InitTrial(kLibraryKey, process.MainWindowHandle);
}
catch (DllNotFoundException ex)
{
// Trial dll is missing close the application immediately.
MessageBox.Show(ex.ToString());
Process.GetCurrentProcess().Kill();
}
catch(Exception ex1)
{
MessageBox.Show(ex1.ToString());
}
}
I did all above, but it doesn't work
Regards
FOLLOW US