For example:
[VPEngine]
- Code: Select all
TVpeLicense = procedure(hDoc: LongInt; serial1: PAnsiChar; serial2: PAnsiChar) stdcall;
@VpeLicense := GetProcAddress(DLLHandle, PAnsiChar(50));
[VPE_VCL]
- Code: Select all
procedure TVPEngine.License(serial1, serial2: String);
{$IFNDEF WIN32} var p, p2:PChar; {$ENDIF}
begin
if hDocument = 0 then raise EVPEError.CreateByCode(VPEVCL_ERR_DOC_NOT_OPEN);
{$IFNDEF WIN32}
p:=StrAlloc(length(serial1)+1);
StrPCopy(p, serial1);
p2:=StrAlloc(length(serial2)+1);
StrPCopy(p2, serial2);
VpeLicense(hDocument, p, p2);
StrDispose(p);
StrDispose(p2);
{$ELSE}
VpeLicense(hDocument, UnicodeToPAnsiChar(serial1), UnicodeToPAnsiChar(serial2));
{$ENDIF}
end;
[Unicode2PAnsiChar]
- Code: Select all
function UnicodeToPAnsiChar(Value : string) : PAnsiChar;
begin
result := PAnsiChar(AnsiString(Value));
end;
That works perfectly with the contents, using Write() and so.
The problem is with the Licence. It show's me, it works as a "Demo", also when the Licence-Serials are transferred.
Could someone help me?