Print Page | Close Window

Unable to Unlock on Mac Version in Firemonkey

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2551
Printed Date: 17 Jun 25 at 10:12AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Unable to Unlock on Mac Version in Firemonkey
Posted By: eddy2099
Subject: Unable to Unlock on Mac Version in Firemonkey
Date Posted: 02 Mar 13 at 12:24AM
I bought the Mac license and using the following codes, I am unable to unlock the library. I tried the trial key which comes with the zip file and still the same issue.

My codes in Firemonkey is as follows

==
unit Unit2;

interface

uses
System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes,
System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;

type
TForm2 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
   ghandle : THandle;

end;

var
Form2: TForm2;

   type
   tsetkey = function(a : integer;key : pchar): integer;
   tpdfcreate = function() : integer;

implementation

{$R *.fmx}

procedure TForm2.Button1Click(Sender: TObject);
var p : Integer;
var setkey : tsetkey;
var pdfcreate : tpdfcreate;
begin

ghandle := LoadLibrary(PChar('libDebenuPDFLibraryDylib0913.dylib')) ;
@pdfcreate := GetProcAddress(ghandle,'DPLCreateLibrary');
   @setkey := GetProcAddress(ghandle,'DPLUnlockKey');
p := pdfcreate();
     label1.Text := IntToStr(p);
   if @setkey <> nil then
        begin

    if setkey(p,pChar('MyLicenseKey')) = 1 then
// this is the trial key
    ShowMessage('Unlocked Done')
    else
    begin

    ShowMessage('Still Locked');
    end;
      end;
end;

end.
==

The Integer P gave me a long integer so I know the CreateLibrary part works but I am just unable to do the unlock, it keeps giving me a 0.

I am feeling kind of stupid as I cannot even get through this stage. If someone would be kind enough to help, I would surely appreciate it.

Thank you.



Replies:
Posted By: Ingo
Date Posted: 02 Mar 13 at 2:08PM
Hi Eddy!

I've "changed" your key ;-)
Yes... i know it's only the testkey.

Cheers and welcome here,
Ingo



Posted By: eddy2099
Date Posted: 04 Mar 13 at 11:32AM
I really hope someone can help me. After I purchased the license after being told that I can be given the DCU version for firemonkey, support no longer replied me.

I am really not sure what is going on with support but I be happy just to be able to get this working.

Thanks,


Posted By: AndrewC
Date Posted: 04 Mar 13 at 12:16PM
Eddy,  I have passed a message onto the developers to look into and get back to you.  For a case like this it would be quicker to go straight to the official QPL support.

Andrew.


Posted By: eddy2099
Date Posted: 04 Mar 13 at 12:42PM
I know but I've contacted them since Feb 28 via email at their help desk but so far no reply as yet, otherwise I wouldn't come by here in desperation.

Thank you Andrew for your help.


Posted By: AndrewC
Date Posted: 05 Mar 13 at 10:38AM
I have has a quick chat with the developer who looked at your code.

1. The functions need to be declared as  cdecl
2. The GetProcAddress need to have the '@' characters removed.

Andrew
type
   tsetkey = function(a : integer; key: pWidechar): integer; cdecl;
   tpdfcreate = function() : integer; cdecl;
 pdfcreate := GetProcAddress(ghandle,'DPLCreateLibrary');
    setkey := GetProcAddress(ghandle,'DPLUnlockKey');


Posted By: eddy2099
Date Posted: 05 Mar 13 at 10:40AM
Thanks. I will give that a try



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk