Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - DPLUnlockkey not working with Powerbuilder 8
  FAQ FAQ  Forum Search   Register Register  Login Login

DPLUnlockkey not working with Powerbuilder 8

 Post Reply Post Reply
Author
Message
jfields View Drop Down
Beginner
Beginner


Joined: 24 Jul 13
Location: Houston
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote jfields Quote  Post ReplyReply Direct Link To This Post Topic: DPLUnlockkey not working with Powerbuilder 8
    Posted: 21 Aug 13 at 3:36AM
Hi all,
 
We have purchased a license and the license works with the vb6 sample code and 9.15 active X object.
 
I am now trying to implement the license in Powerbuilder 8 with the 9.15 dll. 
 
DPLCreateLibrary is returning a nonzero number, so I am assuming that the instance id is good.
 
When I pass the instance id to DPLUnlockkey with our license, DPLUnlockkey returns 0 with no messages.
 
 
I loaded the Powerbuild import header that was for PB version > 10 and removed the "ALIAS FOR" part for these 2 functions.
 
Any help would be appreciated.
 
Thanks,
-Jean
 
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (1) Thanks(1)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 21 Aug 13 at 6:06AM
Powerbuilder 8 uses Ansi strings internally. So you need to use the alias for clause for your external function declaration. Unfortunately, Debenu hasn't been keeping up their include file correctly. From the file for 9.15 I see this:

FUNCTION long DPLUnlockKey(long InstanceID, string LicenseKey) LIBRARY "DebenuPDFLibraryDLL0915.dll" ALIAS FOR "DPLUnlockKey;ansi"

But it should be this:

FUNCTION long DPLUnlockKey(long InstanceID, string LicenseKey) LIBRARY "DebenuPDFLibraryDLL0915.dll" ALIAS FOR "DPLUnlockKeyA;ansi"

So, for every function you use you need to append an A character to the function name so you direct Powerbuilder to use the ansi function not the unicode function.

Hope this helps
Wheeley
Back to Top
jfields View Drop Down
Beginner
Beginner


Joined: 24 Jul 13
Location: Houston
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote jfields Quote  Post ReplyReply Direct Link To This Post Posted: 04 Sep 13 at 1:49AM

Thanks Wheeley for your reply.

My application is not getting to the DPLUnlockKey function, it is throwing an error at DPLCreateLibrary
 
FUNCTION long DPLCreateLibrary() LIBRARY "DebenuPDFLibraryDLL0915.dll" ALIAS FOR "DPLCreateLibrary;ansi"

When I run my application, I get the following error:
Powerbuilder Application Execution Error (R0015)
Application Terminated
Error: Error calling external function DPLCreateLibrary;ansi at line...

As far as I can tell, the DLL is loading into memory correctly.

Anything else I should check?

Thanks in advance,
-Jean

Edit:  I had tried DPLCreateLibraryA, but used DLLExport to find there was no DPLCreateLibraryA function.


Edited by jfields - 04 Sep 13 at 2:07AM
Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 04 Sep 13 at 8:44PM
You only need the ";ansi" when you are passing string arguments. So it should be

FUNCTION long DPLCreateLibrary() LIBRARY "DebenuPDFLibraryDLL0915.dll" ALIAS FOR "DPLCreateLibrary"

OR just

FUNCTION long CreateLibrary() LIBRARY "DebenuPDFLibraryDLL0915.dll" ALIAS FOR "DPLCreateLibrary"

Wheeley
Back to Top
jfields View Drop Down
Beginner
Beginner


Joined: 24 Jul 13
Location: Houston
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote jfields Quote  Post ReplyReply Direct Link To This Post Posted: 13 Sep 13 at 8:59PM
Hi all,
 
Just to let everyone know I finally figured it out through trial and error:
 
Here is how I modified the header file:
 
removed all ";ansi" from every line
 
next, I used a DLL Exporter to find all the function names in the DLL 
 
for functions with corresponding "A" functions, for these functions I added the "A" to the ALIAS FOR name in the header
 
for those functions without corresponding "A" functions, I removed the whole ALIAS FOR part
 
Thanks to all that helped.
-Jean
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 13 at 7:12AM
Jean,

We do not have access here to PowerBuilder 8.  It sounds like version 8 works a little differently to to 9 and 10.  If you can send us your final import file we should be able to include it automatically in future QPL releases.

You can email to to support@debenu.com.

Andrew.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store