I'm trying to integrate the Trial&Registration DLL to a windows service .NET application, but I'm facing a problem.
I made a test console application in order to illustrate what I'm saying.
Code: Select all
using System;
using System.Runtime.InteropServices;
namespace TestLicensing {
class Program {
private const string kLibraryKey = "F1059AF815057E72D12FF5B0B852E699695505F98FE0199C769C6941B963A74AC97904AEC102";
[DllImport("Trial.dll", EntryPoint = "ReadSettingsRetStr", CharSet = CharSet.Ansi)]
static extern uint InitTrial(String aKeyCode, IntPtr aHWnd);
static void Main(string[] args) {
var result = InitTrial(kLibraryKey, IntPtr.Zero);
Console.WriteLine(result);
Console.ReadKey();
}
}
}
I suspect the IntPtr.Zero to be the cause of the problem. Is there a way to call the method without having a window in my program?
Regards
FOLLOW US
Get the latest news in Application Packaging